From a24cb01365e6dd664738fde6aae36a23eb92c7e9 Mon Sep 17 00:00:00 2001 From: s-prechtl Date: Thu, 19 May 2022 14:21:22 +0200 Subject: [PATCH] Daycycle finished --- Assets/BaseTile.prefab | 6 +++--- Assets/Scenes/MainScene.unity | 13 +++++++------ Assets/Scripts/HouseController.cs | 2 -- Assets/Scripts/PlayerController.cs | 1 - Assets/Scripts/TileBehaviour.cs | 12 +++++++----- Assets/Scripts/Tiles/BaseTile.cs | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) 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/Scenes/MainScene.unity b/Assets/Scenes/MainScene.unity index 8a7ba83..6f1b18f 100644 --- a/Assets/Scenes/MainScene.unity +++ b/Assets/Scenes/MainScene.unity @@ -564,7 +564,7 @@ GameObject: - component: {fileID: 757639008} - component: {fileID: 757639007} - component: {fileID: 757639010} - m_Layer: 0 + m_Layer: 5 m_Name: House m_TagString: Untagged m_Icon: {fileID: 0} @@ -622,8 +622,8 @@ SpriteRenderer: m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 + m_SortingLayerID: -278359049 + m_SortingLayer: 2 m_SortingOrder: 0 m_Sprite: {fileID: 21300004, guid: 037b2d58280f32e459042d7c4740d028, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} @@ -644,7 +644,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 757639006} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -4.3651423, y: -0.9205238, z: 0} + m_LocalPosition: {x: -8.93, y: 3.09, z: -1} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: @@ -1144,7 +1144,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 53e4cfe156bc8c4458f719983afdc204, type: 3} m_Name: m_EditorClassIdentifier: - tile: {fileID: 4752245148499717901, guid: 8fd9111325ac85a439c0e1a896f8903d, type: 3} + tile: {fileID: 4752245148499717901, guid: 459572cfc28597a4d93aa1ace783965d, type: 3} CameraGameObject: {fileID: 598358736} --- !u!4 &1291863651 Transform: @@ -1290,9 +1290,10 @@ MonoBehaviour: m_GameObject: {fileID: 1800469988} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 7ff39a43f7a5df74b9d3456085e32adf, type: 3} + m_Script: {fileID: 11500000, guid: 74374ff3b6e24bbaba07d40a46c40188, type: 3} m_Name: m_EditorClassIdentifier: + startMoney: 100 --- !u!4 &1800469990 Transform: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/HouseController.cs b/Assets/Scripts/HouseController.cs index b13f291..5d2de3d 100644 --- a/Assets/Scripts/HouseController.cs +++ b/Assets/Scripts/HouseController.cs @@ -17,8 +17,6 @@ public class HouseController : MonoBehaviour { void Start() { newDayEvent ??= new UnityEvent(); - - newDayEvent.AddListener(newDay); } public void newDay() { diff --git a/Assets/Scripts/PlayerController.cs b/Assets/Scripts/PlayerController.cs index eef9edf..1f37fab 100644 --- a/Assets/Scripts/PlayerController.cs +++ b/Assets/Scripts/PlayerController.cs @@ -17,7 +17,6 @@ public class PlayerController : MonoBehaviour { public static PlayerController getInstance() { return instance; } - // Start is called before the first frame update void Start() diff --git a/Assets/Scripts/TileBehaviour.cs b/Assets/Scripts/TileBehaviour.cs index e4992c0..17a2f18 100644 --- a/Assets/Scripts/TileBehaviour.cs +++ b/Assets/Scripts/TileBehaviour.cs @@ -13,6 +13,8 @@ public class TileBehaviour : MonoBehaviour { Debug.Log("Created"); SetTile(new GrassTile()); + + HouseController.NewDayEvent.AddListener(tile.DayLightStep); } // Update is called once per frame @@ -26,11 +28,11 @@ public class TileBehaviour : MonoBehaviour Debug.Log("Clicked"); // SelectedItem always null for now - BaseTile temp = tile.Clicked(PlayerController.getInstance().SelectedItem); - if (temp != null) - { - SetTile(temp); - } + //BaseTile temp = tile.Clicked(PlayerController.getInstance().SelectedItem); + //if (temp != null) + //{ + // SetTile(temp); + //} } void SetTile(BaseTile tileToSet) diff --git a/Assets/Scripts/Tiles/BaseTile.cs b/Assets/Scripts/Tiles/BaseTile.cs index 1816d03..2abeae9 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)