示例#1
0
        public HighScoreEntry Add(string name, int score)
        {
            HighScoreEntry newEntry = new HighScoreEntry()
            {
                name = name, highScore = score
            };

            highScoreEntries.Add(newEntry);
            return(newEntry);
        }
示例#2
0
        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);
        }
示例#3
0
        public void Add(HighScoreEntry highScoreEntry)
        {
            HighScoreListViewElement element = Instantiate <HighScoreListViewElement>(highScoreListViewElementPrefab, root);

            element.Show(highScoreEntry.name, highScoreEntry.highScore);
        }