예제 #1
0
    public override void OnStart()
    {
        GameManager gameManager = GameManager.Instance;

        gameManager.gameState = GameState.suddenDeath;
        AirBlast.SetSuddenDeath(true);

        gameManager.gameMusic.SetActive(false);
        gameManager.suddenDeathCanvas.SetActive(true);
        gameManager.suddenDeathMusic.SetActive(true);

        EventsManager.Instance.SetActive(false);
    }
예제 #2
0
    // Changes from the inGame state to the suddenDeath state

    /*public void StartSuddenDeath()
     * {
     *  gameState = GameState.suddenDeath;
     *  AirBlast.SetSuddenDeath(true);
     *
     *  gameMusic.SetActive(false);
     *  suddenDeathCanvas.SetActive(true);
     *  suddenDeathMusic.SetActive(true);
     * }
     */

    // Changes to the postGame state
    public void EndGame()
    {
        // Disable player controls
        foreach (GameObject manager in playerManagerObjects)
        {
            manager.GetComponent <PlayerManager>().myPlayer.GetComponent <PlayerControllerRigidbody>().SetDisabled(true);
        }

        gameMusic.SetActive(false);
        victoryCanvas.SetActive(true);
        AudioManager.Instance.PlaySound("Victory");
        suddenDeathCanvas.SetActive(false);
        suddenDeathMusic.SetActive(false);

        AirBlast.SetSuddenDeath(false);

        postGameTimer = postGameLength;
        gameState     = GameState.postGame;

        onGameEnded?.Invoke();
    }