Esempio n. 1
0
 /// <summary>
 /// Ends the playthrough and rewards the player with coins.
 /// </summary>
 public static void EndPlaythrough()
 {
     currentPlayThrough.IncreaseCoinsAfterLevelEnded();
     GameStats.Instance.RewardCoins(currentPlayThrough.PlaythroughCoins);
     GameStats.Instance.Save();
     saveSystem.Clear();
     currentPlayThrough = new Playthrough();
     saveSystem.Add(currentPlayThrough);
     saveSystem.Save(Files.PLAYTHROUGH_FNAME);
     saveSystem.Clear();
 }
Esempio n. 2
0
        /// <summary>
        /// Alternative for LoadRandomLevelSet(bool, true, DEFAULT_LEVEL_AMOUNT, true);
        /// Creates a new playthrough
        /// </summary>
        /// <param name="instantplay">Whether to launch a level from the set</param>
        public static void NewPlayThrough(bool instantplay)
        {
            Debug.Log("Current playthrough difficulty: " + Difficulty);
            currentPlayThrough = new Playthrough();
            LoadRandomLevelSet(instantplay, true, DEFAULT_LEVEL_AMOUNT, true);

            if (MobileHelper.OnEditor)
            {
                Debug.Log("Current playthrough difficulty: " + Difficulty);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Loads a playthrough from file, or creates a new one from scratch
        /// </summary>
        public static void LoadPlayThrough(bool instantplay)
        {
            //Prevent duplicate load in SaveSystem instance
            saveSystem.Clear();
            saveSystem.Load(Files.PLAYTHROUGH_FNAME);

            currentPlayThrough = saveSystem.GetObject <Playthrough>();
            if (currentPlayThrough == null)
            {
                saveSystem.Clear();
                NewPlayThrough(instantplay);
            }
            else
            {
                LoadCurrentLevel();
            }
        }