Exemplo n.º 1
0
 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();
     }
 }
Exemplo n.º 2
0
 void Start()
 {
     if (!alreadyInitialized)
     {
         SceneHandler.Init();              //Instantiate SceneHandler with list of existing scenes and return stack
         SaveLoad.Load();
         StaticCharacterHolder.Init();
         InputSettings.Init();
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Goes back to main menu.
 /// </summary>
 public void GoToMainMenu()
 {
     StaticCharacterHolder.ResetCharacters();
     SceneHandler.GoBackToScene("MainMenuScene");
 }
Exemplo n.º 4
0
 /// <summary>
 /// Goes back to move selection.
 /// </summary>
 public void GoToMoveSelection()
 {
     StaticCharacterHolder.ResetCharacters();
     SceneHandler.GoBackToScene("MoveSelectionScene");
 }