Example #1
0
    public void LoadHighScores()
    {
        HighScoresData loadedScoresData = HighScoresSerializer.Load();

        if (loadedScoresData != null)
        {
            ScoresData.ResetScore();

            int minLength = Mathf.Min(ScoresData.scores.Length, loadedScoresData.scores.Length);
            for (int i = 0; i < minLength; i++)
            {
                ScoresData.AttemptAddScore(loadedScoresData.scores[i]);
            }
        }
    }
Example #2
0
 private void SaveHighScores()
 {
     HighScoresSerializer.Save(HighScores.Instance.ScoresData);
 }