Esempio n. 1
0
    public void LoadScores()
    {
        string scoresString = PlayerPrefs.GetString(HIGH_SCORES_KEY);

        highScores = JsonUtility.FromJson <HighScoresList>(scoresString);
        Debug.Log(scoresString);
        //HighScoresByDifficulty = highScores.list.ToDictionary(x => x.difficultyName);
    }
Esempio n. 2
0
 private void Awake()
 {
     LoadScores();
     if (highScores == null)
     {
         var difficultyNames = difficultyOptions.difficulties.Where(d => d.customDifficulty == false).Select(d => d.difficultyName).ToList();
         highScores = new HighScoresList(difficultyNames);
     }
     foreach (var difficultyName in difficultyOptions.GetDifficultyNames())
     {
         Debug.Log("Difficulty:" + difficultyName);
         highScores.GetByDifficulty(difficultyName);
     }
 }