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); }
// 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(); }