public HighScoreEntry Add(string name, int score) { HighScoreEntry newEntry = new HighScoreEntry() { name = name, highScore = score }; highScoreEntries.Add(newEntry); return(newEntry); }
public void SaveScore(string name) { if (string.IsNullOrEmpty(name)) { return; } inputField.enabled = false; HighScoreEntry newEntry = highScoreList.Add(name, bounceCounter.Score); SaveToFile(JsonUtility.ToJson(highScoreList)); highScoreListView.Add(newEntry); }
public void Add(HighScoreEntry highScoreEntry) { HighScoreListViewElement element = Instantiate <HighScoreListViewElement>(highScoreListViewElementPrefab, root); element.Show(highScoreEntry.name, highScoreEntry.highScore); }