Esempio n. 1
0
    // Restart the game
    public void restartGame()
    {
        // If the current game state is Paused
        if (getCurrentGameState() == PossibleGameStates.Paused)
        {
            // If the Pause HUD is visible
            // Hide it
            if (pauseHUD.getIsHUDVisible() == true)
            {
                pauseHUD.hideHUD();
            }
        }

        // If the current game state is finished
        else if (getCurrentGameState() == PossibleGameStates.Finished)
        {
            // If the Game Over HUD is visible
            // Hide it
            if (gameOverHUD.getIsHUDVisible() == true)
            {
                gameOverHUD.hideHUD();
            }
        }

        // Load the current level again after a delay
        StartCoroutine(levelTransitionManagerRef.loadLevelWithDelay(SceneManager.GetActiveScene().name, 2.0f));
    }
Esempio n. 2
0
    // Launch game
    private void launchGame()
    {
        // Hide this HUD
        hideHUD();

        // Launch game stage
        StartCoroutine(levelTransitionManagerRef.loadLevelWithDelay(gameStageLevelAddress, 2.0f));
    }