Ejemplo n.º 1
0
    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);
    }