diff --git a/Assets/Scripts/ShopKeeper/ShopManager.cs b/Assets/Scripts/ShopKeeper/ShopManager.cs index 6749b249ad7194d1aeee858b31bc5add37e413d4..c3d30e10153affd9af4250f0b2d98ab640b03ca4 100644 --- a/Assets/Scripts/ShopKeeper/ShopManager.cs +++ b/Assets/Scripts/ShopKeeper/ShopManager.cs @@ -7,8 +7,9 @@ using Nightmare; public class ShopManager : MonoBehaviour, IDataPersistence { - public float coins = 0; + public float coins = 50; public float increment = 50; + public int currentReward = 1; public TMP_Text coinUI; public ShopItemSO[] shopItemsSO; public GameObject[] shopPanelsGO; @@ -19,7 +20,7 @@ public class ShopManager : MonoBehaviour, IDataPersistence // Start is called before the first frame update void Start() { - coins = 0; + coins = 50; UpdateCoinsUI(); for (int i = 0; i < shopItemsSO.Length; i++) @@ -95,11 +96,16 @@ public class ShopManager : MonoBehaviour, IDataPersistence void OnEnable() { - coins += increment; - increment += 50; + if (LevelManager.Instance.currentQuest >= currentReward) + { + coins += increment; + increment += 50; - UpdateCoinsUI(); - CheckPurchaseable(); + UpdateCoinsUI(); + CheckPurchaseable(); + + currentReward = LevelManager.Instance.currentQuest + 1; + } } void UpdateCoinsUI()