예제 #1
0
        public static void InitializeGame(AchievementController ac)
        {
            SaveData data = SaveHandler.Load <SaveData>("save_file"); //!

            if (data != null)
            {//! no previous save file --> no progress in game
                for (int i = 0; i < Traits.UNLOCKABLES_CONSTANT; i++)
                {
                    if (data.unlocks[i]) //If crash here, delete save file
                    {
                        ac.Achievements[i].AlreadyUnlocked();
                    }
                }
                ScoreHandler.Score = data.Score;
            }
        }
예제 #2
0
        public void SaveProgress(AchievementController ac)
        {
            unlocks = new bool[ac.Achievements.Count];
            for (int i = 0; i < ac.Achievements.Count; i++)
            {
                if (ac.Achievements[i].Unlocked)
                {
                    unlocks[i] = true;
                }
            }

            Score = (int)Traits.SCORE.Counter;
            if (ScoreHandler.HighScore > Score)
            {
                Score = ScoreHandler.HighScore;
            }
        }