public static bool Save(Highscore score) { List<Highscore> scores = FindBest10(); if (scores.Count < 10 || scores[9].Score < score.Score) { bool result = Facade<Highscore>.Save(score); //Debug.Log(result.ToString()); if (result) DeleteOverBest10(); return result; } return true; }
public static void InsertTestHighScore() { Highscore score = new Highscore() { Name = "Test" + ((int)(UnityEngine.Random.value * 100)).ToString(), Score = (int)(UnityEngine.Random.value * 1000) }; Debug.LogFormat("Test Score: {0}", score.ToString()); HighscoreFacade.Save(score); }
public static void Delete(Highscore highscore) { Facade<Highscore>.Delete(highscore); }