diff --git a/Assets/Scripts/DataUtils/GameData.cs b/Assets/Scripts/DataUtils/GameData.cs index 7ad37e962fe64685aec28a49a561cca0e97689f8..35aef94d33f62f9a465d08588ffee1ae69a29a6a 100644 --- a/Assets/Scripts/DataUtils/GameData.cs +++ b/Assets/Scripts/DataUtils/GameData.cs @@ -22,6 +22,7 @@ public class GameData public string timestamp; public bool isShopKeeper; public float increment; + public int currentReward; // Constructor buat default values kalau new game public GameData() @@ -42,6 +43,7 @@ public class GameData this.timestamp = string.Empty; this.isShopKeeper = false; this.increment = 50; + this.currentReward = 1; } public GameData(int currentScene) @@ -62,6 +64,7 @@ public class GameData this.timestamp = string.Empty; this.isShopKeeper = false; this.increment = 50; + this.currentReward = 1; } } diff --git a/Assets/Scripts/Managers/DataPersistenceManager.cs b/Assets/Scripts/Managers/DataPersistenceManager.cs index a7fabd94d526f7501205767253e13f23496ebf6d..1019d91eb51f762b329162ada31091b979a07115 100644 --- a/Assets/Scripts/Managers/DataPersistenceManager.cs +++ b/Assets/Scripts/Managers/DataPersistenceManager.cs @@ -166,7 +166,6 @@ public class DataPersistenceManager : MonoBehaviour for (int i = dataPersistenceList.Count-1; i >= 0; i--) { dataPersistenceList[i].LoadData(gameData); - Debug.Log(dataPersistenceList[i].ToString()); } Debug.Log("Load Game called"); diff --git a/Assets/Scripts/ShopKeeper/TimerScript.cs b/Assets/Scripts/ShopKeeper/TimerScript.cs index a571c520dcd7f97e0196b8d155bdbb970f29701e..c6d0f697197448bcea0591d7d29b4aa0f3867dcd 100644 --- a/Assets/Scripts/ShopKeeper/TimerScript.cs +++ b/Assets/Scripts/ShopKeeper/TimerScript.cs @@ -13,13 +13,11 @@ public class TimerScript : MonoBehaviour, IDataPersistence void Start() { - ResetTimer(); StartTimerCountDown(); } void OnEnable() { - ResetTimer(); StartTimerCountDown(); } @@ -51,6 +49,7 @@ public class TimerScript : MonoBehaviour, IDataPersistence shopCanvas.gameObject.SetActive(false); shopInstructionCanvas.gameObject.SetActive(false); StopTimerCountDown(); + ResetTimer(); } private void UpdateTimerDisplay()