diff --git a/Assets/BaseTile.prefab b/Assets/BaseTile.prefab index 517481a..2181f70 100644 --- a/Assets/BaseTile.prefab +++ b/Assets/BaseTile.prefab @@ -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: diff --git a/Assets/Scripts/DayController.cs.meta b/Assets/Scripts/DayController.cs.meta deleted file mode 100644 index f39a7bc..0000000 --- a/Assets/Scripts/DayController.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 7dcb0c75c1d32a949af7eb4303f3b6a6 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/DayController.cs b/Assets/Scripts/HouseController.cs similarity index 61% rename from Assets/Scripts/DayController.cs rename to Assets/Scripts/HouseController.cs index 115fd3b..5d2de3d 100644 --- a/Assets/Scripts/DayController.cs +++ b/Assets/Scripts/HouseController.cs @@ -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); + } } \ No newline at end of file diff --git a/Assets/Scripts/TileBehaviour.cs b/Assets/Scripts/TileBehaviour.cs index f2bcbb0..f2c9e14 100644 --- a/Assets/Scripts/TileBehaviour.cs +++ b/Assets/Scripts/TileBehaviour.cs @@ -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().color = tile.getColor; // TODO: Change to Sprite } -} \ No newline at end of file +} diff --git a/Assets/Scripts/Tiles/BaseTile.cs b/Assets/Scripts/Tiles/BaseTile.cs index 949019b..0450179 100644 --- a/Assets/Scripts/Tiles/BaseTile.cs +++ b/Assets/Scripts/Tiles/BaseTile.cs @@ -29,7 +29,7 @@ namespace Tiles public void DayLightStep() { - + Debug.Log("I evolve"); } public BaseTile Clicked(UsableItem usable) diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index 1c92a78..6157255 100644 --- a/ProjectSettings/TagManager.asset +++ b/ProjectSettings/TagManager.asset @@ -41,3 +41,9 @@ TagManager: - name: Default uniqueID: 0 locked: 0 + - name: Background + uniqueID: 2278647887 + locked: 0 + - name: Object + uniqueID: 4016608247 + locked: 0