public void Awake() { SaveLoad.Save(stats); SaveSkills.Save(skills); GameManager.StatsManager.stats.ClearStats(); SaveData savedData = SaveLoad.Load(); highScore = savedData.highScore; stats.highScore = savedData.highScore; stats.numberOfGames = savedData.numberOfGames; stats.totalTimeSpent = savedData.totalTimeSpent; stats.gold = savedData.gold; stats.unlockedSkills = savedData.unlockedSkills.ToList(); stats.leftSkill = savedData.leftSkill; stats.rightSkill = savedData.rightSkill; List <SaveSkillsData> savedSkillsData = SaveSkills.Load(); for (int i = 0; i < savedSkillsData.Count; i++) { skills[i].Name = savedSkillsData[i].Name; skills[i].Amount = savedSkillsData[i].Amount; } }
private void Update() { SaveLoad.Save(stats); SaveSkills.Save(skills); }