diff --git a/Assets/Scenes/Level01.unity b/Assets/Scenes/Level01.unity index c01aff7caaa71255659ad3e3b5a37fa21998ec7b..60da8234aa08f13d3d85a45b71f4ff6fdb8af7db 100644 --- a/Assets/Scenes/Level01.unity +++ b/Assets/Scenes/Level01.unity @@ -15655,7 +15655,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 3854428197638761884, guid: 33c68c33f3888be4e957c37834df7765, type: 3} propertyPath: m_IsActive - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4402895682815482158, guid: 33c68c33f3888be4e957c37834df7765, type: 3} propertyPath: m_Pivot.x diff --git a/Assets/Scripts/Managers/LevelManager.cs b/Assets/Scripts/Managers/LevelManager.cs index b521a2b75281506496ac173507ed4173dc919564..f7369b878043ee905cb54fddac43b80b1703df81 100644 --- a/Assets/Scripts/Managers/LevelManager.cs +++ b/Assets/Scripts/Managers/LevelManager.cs @@ -214,7 +214,10 @@ namespace Nightmare winQuest = false; isShopKeeper = true; if (shopKeeper) shopKeeper.SetActive(true); - if (timerCanvas) timerCanvas.SetActive(true); + if (timerCanvas) + { + timerCanvas.SetActive(true); + } if (saveHouse) saveHouse.enabled = true; // Disable skipQuest diff --git a/Assets/Scripts/ShopKeeper/CollisionDetection.cs b/Assets/Scripts/ShopKeeper/CollisionDetection.cs index 185ddad1cc9e2e547ad4f9d3377d6210fe55f26f..c0c1e990807a49b9e6e93a611b853b39ecc1d0de 100644 --- a/Assets/Scripts/ShopKeeper/CollisionDetection.cs +++ b/Assets/Scripts/ShopKeeper/CollisionDetection.cs @@ -60,7 +60,6 @@ public class CollisionDetection : MonoBehaviour shopCanvas.gameObject.SetActive(false); shopInstructionCanvas.gameObject.SetActive(false); timerColor.a = 1f; - timerCanvasTimerUI.color = timerColor; } } @@ -69,7 +68,6 @@ public class CollisionDetection : MonoBehaviour shopCanvas.gameObject.SetActive(false); shopInstructionCanvas.gameObject.SetActive(true); timerColor.a = 1f; - timerCanvasTimerUI.color = timerColor; } } diff --git a/Assets/Scripts/ShopKeeper/TimerScript.cs b/Assets/Scripts/ShopKeeper/TimerScript.cs index c6d0f697197448bcea0591d7d29b4aa0f3867dcd..c3b6b2a7b8256ffb2e016ba6261d75379da502b8 100644 --- a/Assets/Scripts/ShopKeeper/TimerScript.cs +++ b/Assets/Scripts/ShopKeeper/TimerScript.cs @@ -9,7 +9,8 @@ public class TimerScript : MonoBehaviour, IDataPersistence public Canvas shopCanvas; public Canvas shopInstructionCanvas; public Canvas timerCanvas; - private float timer = 60f; + public float timer = 60f; + public bool finishLoad = false; void Start() { @@ -24,11 +25,13 @@ public class TimerScript : MonoBehaviour, IDataPersistence void OnDisable() { StopTimerCountDown(); + this.timer = 60f; } public void LoadData(GameData data) { this.timer = data.shopKeeperTime; + finishLoad = true; } public void SaveData(ref GameData data) @@ -49,14 +52,19 @@ public class TimerScript : MonoBehaviour, IDataPersistence shopCanvas.gameObject.SetActive(false); shopInstructionCanvas.gameObject.SetActive(false); StopTimerCountDown(); - ResetTimer(); } private void UpdateTimerDisplay() { - int minutes = Mathf.FloorToInt(timer / 60); - int seconds = Mathf.FloorToInt(timer % 60); - timerUI.text = "Shop close in: " + string.Format("{0:00}:{1:00}", minutes, seconds); + if (finishLoad) + { + int minutes = Mathf.FloorToInt(timer / 60); + int seconds = Mathf.FloorToInt(timer % 60); + timerUI.text = "Shop close in: " + string.Format("{0:00}:{1:00}", minutes, seconds); + } else + { + timerUI.text = ""; + } } private void StartTimerCountDown()