public void Die(Timer timer) { timer.Stop(); Highscores.Add(this.username, timer.seconds); alive = false; appendLogLine("\n<color=red>Connection timed out!</color>\nConnection time: " + timer.asString()); }
private bool AddHighscore(Highscore hs) { var count = Highscores.Count(x => x != null); var score = hs.Score; var index = GetIndexHS(Highscores, score); if (index >= Highscores.Count) { return(false); } Highscores.Add(hs); return(true); }
public override void OnInspectorGUI() { DrawDefaultInspector(); scoreboard myScript = (scoreboard)target; if (GUILayout.Button("Clear Scores")) { Highscores.Clear(); } if (GUILayout.Button("Add Rabndom Score")) { Highscores.Add("test" + Random.Range(0, 100).ToString(), Random.Range(10, 10000)); } }
public void AddHighscoreEntry(int time, string name) { Highscores.Add(time, name); Highscores.Save(); foreach (Transform t in entryContainer.transform) { GameObject.Destroy(t.gameObject); } highscoreEntryTransformList = new List <Transform>(); for (int i = 0; i < Highscores.Count; i++) { HighscoreEntry highscoreEntry = Highscores.Get(i); CreateHighscoreEntryTransform(highscoreEntry, entryContainer, highscoreEntryTransformList); } }
public static void Submit(string name) { Highscores.Add(name, score); resetCombo(); score = 0; }