Esempio n. 1
0
    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;
        }
    }
Esempio n. 2
0
 private void Update()
 {
     SaveLoad.Save(stats);
     SaveSkills.Save(skills);
 }