private void ReadInHighscores() { ScoreEntry newScore = ScoreEntry.New(Score, "", SettingsHandler.cache.dificulty, time, kills); highscores.Add(newScore); highscores.Sort(); int index = highscores.FindIndex((x) => x.Equals(newScore)); SceneHandler.instance.haltTransitionIn++; HighscoreHandler.instance.Display(index); if (!SettingsHandler.cache.preloadHighscores) { StartCoroutine(UpdateHighscoreProgress()); } }
private void OnSubmit(string name) { if (name == "" || name == null) { // TODO: tell user name cant be blank return; } playerName = name; if (SettingsHandler.cache.preloadHighscores) { HighscoreHandler.instance.newest.SetNewName(playerName); } DisplayHighscores(); AddScore(ScoreEntry.New(Score, name, SettingsHandler.cache.dificulty, time, kills)); }
private void ShowNameSelect() { GetScores(); deathUI.SetActive(false); nameSubmitUI.SetActive(true); afterGameEntry.Initialize(ScoreEntry.New(Score, "", SettingsHandler.cache.dificulty, time, kills), 0); if (SettingsHandler.cache.showControllerKeyboard) { controllerKeyboard.gameObject.SetActive(true); keyFirstSelected.Select(); } else { nameInput.Select(); } if (SettingsHandler.cache.preloadHighscores) { highscores.Sort(); ReadInHighscores(); } }