Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
207d07b026
6 changed files with 26 additions and 23 deletions
|
|
@ -72,8 +72,8 @@ SpriteRenderer:
|
|||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingLayerID: -2016319409
|
||||
m_SortingLayer: 1
|
||||
m_SortingOrder: 0
|
||||
m_Sprite: {fileID: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
|
|
@ -121,6 +121,6 @@ MonoBehaviour:
|
|||
m_GameObject: {fileID: 4752245148499717901}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 9a992c82c9da0cd4f8759894ddfd5fb3, type: 3}
|
||||
m_Script: {fileID: 11500000, guid: 99a22f4d69ce79542adc91bba6943f86, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7dcb0c75c1d32a949af7eb4303f3b6a6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -4,24 +4,28 @@ using System.Collections.Generic;
|
|||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
public class DayController : MonoBehaviour {
|
||||
public class HouseController : MonoBehaviour {
|
||||
private int dayCount = 0;
|
||||
private static UnityEvent newDayEvent;
|
||||
public static UnityEvent NewDayEvent => newDayEvent;
|
||||
|
||||
public Canvas menu;
|
||||
|
||||
private void OnMouseDown() {
|
||||
newDay();
|
||||
toggleMenu();
|
||||
}
|
||||
|
||||
void Start() {
|
||||
newDayEvent ??= new UnityEvent();
|
||||
|
||||
newDayEvent.AddListener(newDay);
|
||||
}
|
||||
|
||||
private void newDay() {
|
||||
public void newDay() {
|
||||
dayCount++;
|
||||
Debug.Log("New day: " + dayCount);
|
||||
newDayEvent?.Invoke();
|
||||
}
|
||||
|
||||
public void toggleMenu() {
|
||||
menu.gameObject.SetActive(!menu.gameObject.activeSelf);
|
||||
}
|
||||
}
|
||||
|
|
@ -8,22 +8,26 @@ using UnityEngine;
|
|||
public class TileBehaviour : MonoBehaviour
|
||||
{
|
||||
private BaseTile tile;
|
||||
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
Debug.Log("Created");
|
||||
SetTile(new GrassTile());
|
||||
|
||||
HouseController.NewDayEvent.AddListener(tile.DayLightStep);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void OnMouseDown()
|
||||
{
|
||||
Debug.Log("Clicked");
|
||||
|
||||
UsableItem usable = PlayerController.instance.GetSelectedItem();
|
||||
BaseTile tileToSetTo = null;
|
||||
if (usable.GetType() == typeof(TerraformingTool))
|
||||
|
|
@ -48,4 +52,4 @@ public class TileBehaviour : MonoBehaviour
|
|||
tile = tileToSet;
|
||||
GetComponent<SpriteRenderer>().color = tile.getColor; // TODO: Change to Sprite
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ namespace Tiles
|
|||
|
||||
public void DayLightStep()
|
||||
{
|
||||
|
||||
Debug.Log("I evolve");
|
||||
}
|
||||
|
||||
public BaseTile Clicked(UsableItem usable)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue