Esempio n. 1
0
 private void Update()
 {
     // Set current scene to the build index
     currentScene = SceneManager.GetActiveScene().buildIndex;
     if (currentScene != 0 && currentScene != 6)
     {
         if (player == null)
         {
             // Respawn player if we have lives remaining
             if (playerLives > 0)
             {
                 if (currentScene != 4)
                 {
                     playerRespawn();
                 }
             }
             else
             {
                 // if our scene isnt the loss screen then load loss scene when we run out of lives
                 if (currentScene != 4 && currentScene != 5 && currentScene != 6)
                 {
                     sceneScript.LoadLoss();
                 }
             }
         }
     }
     else
     {
         resetGame();
     }
 }