Пример #1
0
 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());
 }
Пример #2
0
        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);
        }
Пример #3
0
    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));
        }
    }
Пример #4
0
    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);
        }
    }
Пример #5
0
 public static void Submit(string name)
 {
     Highscores.Add(name, score);
     resetCombo();
     score = 0;
 }