diff --git a/Assets/Scripts/Managers/ShopkeeperManager.cs b/Assets/Scripts/Managers/ShopkeeperManager.cs index 570d9dcb5a1aa08aab0467dd52a053160d98ae92..401b3bf2464effa49e010db28971c754df6e2f53 100644 --- a/Assets/Scripts/Managers/ShopkeeperManager.cs +++ b/Assets/Scripts/Managers/ShopkeeperManager.cs @@ -2,7 +2,7 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; -public class ShopkeeperManager : MonoBehaviour +public class ShopkeeperManager : MonoBehaviour, IDataPersistence { Animator anim; int w1=0; @@ -111,5 +111,14 @@ public class ShopkeeperManager : MonoBehaviour    mapping[p].text = "" + inventory[p];    Debug.Log("DECREASEPET "+inventory[p]); } -   + + public void LoadData(GameData data) + { + this.inventory = data.inventory; + } + + public void SaveData(ref GameData data) + { + data.inventory = this.inventory; + } } diff --git a/Assets/Scripts/Quest/QuestDetail.cs b/Assets/Scripts/Quest/QuestDetail.cs index 5fb8a8e2fa9f83e5ae1b09825dbb13f94dd4752e..66f98b8281b828da004a7199c97a52868a6eafe7 100644 --- a/Assets/Scripts/Quest/QuestDetail.cs +++ b/Assets/Scripts/Quest/QuestDetail.cs @@ -145,9 +145,9 @@ public class QuestDetail : MonoBehaviour, IDataPersistence if (onQuest == false && questLevel == 6) { QuestDescription.message = "\nYou Got a new Quest\n\nkill 4 hellephant"; - hellephantKillNeeded = 4; - zombearKillNeeded = 0; - zombunnyKillNeeded = 0; + hellephantKillNeeded = 0; + zombearKillNeeded = 7; + zombunnyKillNeeded = 7; Time.timeScale = 0; OpenPanel(); @@ -161,9 +161,9 @@ public class QuestDetail : MonoBehaviour, IDataPersistence if (onQuest == false && questLevel == 8) { QuestDescription.message = "\nYou Got a new Quest\n\nkill 4 zombear\nkill 4 zombunny\nkill 4 hellephant"; - zombearKillNeeded = 4; - zombunnyKillNeeded = 4; - hellephantKillNeeded = 4; + zombearKillNeeded = 0; + zombunnyKillNeeded = 0; + hellephantKillNeeded = 15; Time.timeScale = 0; OpenPanel(); diff --git a/Assets/Scripts/Save/GameData.cs b/Assets/Scripts/Save/GameData.cs index 683e63a46ad2ce21b7637855d5e80448a4ff8546..1c1f1b158d67bf1c4df2c7c02e3388c6f0108474 100644 --- a/Assets/Scripts/Save/GameData.cs +++ b/Assets/Scripts/Save/GameData.cs @@ -20,6 +20,10 @@ public class GameData public List<bool> weaponBought = new List<bool>(); // -------------- + // Shop Manager + public Dictionary<string, int> inventory = new Dictionary<string, int>(){{"w1",0},{"w2",0},{"w3",0},{"p1",0},{"p2",0},{"p3",0}}; + // ------------- + // the values defined in this constructor will be the default values // the game starts with when theres no data to load