public void GetScores() { ScoreEntry[] scores = new ScoreEntry[numHighscores]; for (int i = 0; i < numHighscores; i++) { scores[i] = ScoreEntry.Read(i); } highscores = scores.ToList(); }
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); } }
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); }