private void LoadHighscores()
 {
     highscores = PPSerialisation.Load(highscoreSaveTag) as List <Highscore>;
     if (highscores == null)
     {
         highscores = new List <Highscore>();
     }
 }
    public void SaveHighscore(float distanceTravelled, int score)
    {
        Highscore newHighscore = new Highscore(distanceTravelled, score);

        highscores.Add(newHighscore);

        // Invoke the new highscore set event if the new highscore is the highest score
        if (GetHighestScore() == newHighscore && newHighscoreSet != null)
        {
            newHighscoreSet.Invoke();
        }

        gpgsManager.SaveHighscore(score);
        PPSerialisation.Save(highscoreSaveTag, highscores);
    }
Exemple #3
0
 public static void LoadAllInformation()
 {
     GameInformation.PlayerName         = PlayerPrefs.GetString("PLAYERNAME");
     GameInformation.PlayerLevel        = PlayerPrefs.GetInt("PLAYERLEVEL");
     GameInformation.PlayerStrength     = PlayerPrefs.GetInt("PLAYERSTRENGTH");
     GameInformation.PlayerIntelligence = PlayerPrefs.GetInt("PLAYERINTELLIGENCE");
     GameInformation.PlayerFaith        = PlayerPrefs.GetInt("PLAYERFAITH");
     GameInformation.PlayerAgility      = PlayerPrefs.GetInt("PLAYERAGILITY");
     GameInformation.PlayerResistance   = PlayerPrefs.GetInt("PLAYERRESISTANCE");
     GameInformation.PlayerGold         = PlayerPrefs.GetInt("PLAYERGOLD");
     if (PlayerPrefs.GetString("EQUIPMENTITEM1") != null)
     {
         GameInformation.EquipmentOne = (BaseEquipment)PPSerialisation.Load("EQUIPMENTITEM1");
     }
 }
Exemple #4
0
 public static void SaveAllInformation()
 {
     PlayerPrefs.SetString("PLAYERNAME", GameInformation.PlayerName);
     PlayerPrefs.SetInt("PLAYERLEVEL", GameInformation.PlayerLevel);
     PlayerPrefs.SetInt("PLAYERSTRENGTH", GameInformation.PlayerStrength);
     PlayerPrefs.SetInt("PLAYERINTELLIGENCE", GameInformation.PlayerIntelligence);
     PlayerPrefs.SetInt("PLAYERFAITH", GameInformation.PlayerFaith);
     PlayerPrefs.SetInt("PLAYERAGILITY", GameInformation.PlayerAgility);
     PlayerPrefs.SetInt("PLAYERRESISTANCE", GameInformation.PlayerResistance);
     PlayerPrefs.SetInt("PLAYERGOLD", GameInformation.PlayerGold);
     if (GameInformation.EquipmentOne != null)
     {
         PPSerialisation.Save("EQUIPMENTITEM1", GameInformation.EquipmentOne);
     }
     Debug.Log("INFORMATION SAVED");
 }
 private void SaveHighscores()
 {
     PPSerialisation.Save(highscoreSaveTag, highscores);
 }