void Update() { //Wait for 2.5 seconds then show the text saying "Press any key to continue". if (gameOver) { if (timeUntilPressAnyKey > 0) { timeUntilPressAnyKey -= Time.deltaTime; } else { pressAnyKeyText.enabled = true; pressAnyKeyToContinue = true; } } //Pause game when a player presses the escape key. if ((Input.GetKeyDown(KeyCode.Escape) || Input.GetButtonDown("Controller1Button7") || Input.GetButtonDown("Controller2Button7")) && !gameOver) { PauseUnpause(); } //If presAnyKeyToContinue is true (which it is 2.5 seconds after a player dies), go back to move selection on key press. else if (pressAnyKeyToContinue && Input.anyKeyDown) { StaticCharacterHolder.ResetCharacters(); SceneHandler.GoBack(); } }
void Start() { if (!alreadyInitialized) { SceneHandler.Init(); //Instantiate SceneHandler with list of existing scenes and return stack SaveLoad.Load(); StaticCharacterHolder.Init(); InputSettings.Init(); } }
/// <summary> /// Goes back to main menu. /// </summary> public void GoToMainMenu() { StaticCharacterHolder.ResetCharacters(); SceneHandler.GoBackToScene("MainMenuScene"); }
/// <summary> /// Goes back to move selection. /// </summary> public void GoToMoveSelection() { StaticCharacterHolder.ResetCharacters(); SceneHandler.GoBackToScene("MoveSelectionScene"); }