private void Update() { if (Input.GetKeyDown(KeyCode.Escape) && gameIsRunning) { StartPauseGame(false); if (TournamentTracker.IsTournamentRunning()) { pauseMenu_T.gameObject.SetActive(true); } else { pauseMenu.gameObject.SetActive(true); } } if (gameTimer > 3550f) { StopGame(); ///makes sure the timer can't go over one hour ResetGame(); } cursorMoving = Input.GetAxis("Mouse X") < 0 || (Input.GetAxis("Mouse X") > 0); if (gameIsRunning) { gameTimer += Time.deltaTime; timeScore.text = TimeSpan.FromSeconds(gameTimer).ToString(@"mm\:ss\:ff"); ///formatting the countdown output ManageCursorVisibility(); } if (gameOver) { MovePlayerInGoal(); spectatorHandler.EndOfGameReaction(WinState.Win); } }
public void TournamentConfirmQuitMenu() { if (TournamentTracker.IsTournamentRunning()) { tournamentConfirmQuit.SetActive(true); } else { sceneHandler.LoadLevel("04_MainMenu"); } }
IEnumerator WaitForSound() { yield return(new WaitForSeconds(audioSource.clip.length)); if (TournamentTracker.IsTournamentRunning()) { tournamentTracker.NextLevel(); } else { sceneHandler.LoadLevel(scene); } }
public void BuildLevelEndMenu() { if (TournamentTracker.IsTournamentRunning()) { endOfGameMenu_T.SetActive(true); populateHighscore = endOfGameMenu_T.GetComponentInChildren <PopulateHighscore>(); scoreTextObject_T.GetComponent <TMP_Text>().text = highscoreHandler.GetHighscoreText(); } else { endOfGameMenu.SetActive(true); populateHighscore = endOfGameMenu.GetComponentInChildren <PopulateHighscore>(); scoreTextObject.GetComponent <TMP_Text>().text = highscoreHandler.GetHighscoreText(); } populateHighscore.NewGrid(); populateHighscore.NewLevelScore(SceneHandler.GetSceneName()); }