コード例 #1
0
    public void GetScores()
    {
        ScoreEntry[] scores = new ScoreEntry[numHighscores];
        for (int i = 0; i < numHighscores; i++)
        {
            scores[i] = ScoreEntry.Read(i);
        }

        highscores = scores.ToList();
    }
コード例 #2
0
ファイル: HighscoreEntry.cs プロジェクト: BeetYeet/Game_4.0
 private void Start()
 {
     if (isMenuEntry && ScoreEntry.Exists(0))
     {
         int          numHighscores = PlayerPrefs.GetInt("numHighscores", 0);
         ScoreEntry[] scores        = new ScoreEntry[numHighscores];
         for (int i = 0; i < numHighscores; i++)
         {
             scores[i] = ScoreEntry.Read(i);
         }
         List <ScoreEntry> highscores = scores.ToList();
         highscores.Sort();
         Initialize(highscores[0], 0);
     }
 }
コード例 #3
0
    public bool GetPartialScores()
    {
        if (highscores == null)
        {
            highscores = new List <ScoreEntry>();
        }
        int toGo = Mathf.Clamp(numHighscores - highscores.Count, 0, 3);

        for (int i = 0; i < toGo; i++)
        {
            highscores.Add(ScoreEntry.Read(highscores.Count));
        }
        if (toGo != 0)
        {
            return(true);
        }
        return(false);
    }