private void GameIsOver() { GameObject.FindGameObjectWithTag("Controller").GetComponent <UserInterfaceButtons>().Playing = false; GameOverScr.SetActive(true); GameOverSource.PlayOneShot(GameOverSFX); GameOver(); Debug.Log("Game Over!"); GameObject.FindGameObjectWithTag("Controller").GetComponent <UserInterfaceButtons>().SetAnimationIdle(); GameObject.FindGameObjectWithTag("SFXController").GetComponent <ModelSoundManager>().StopLoopSound(); }
private bool CheckIfGameOver(GameOverSource source, int food) { if (food <= 0) { SoundManager.instance.PlaySingle(gameOverSound); SoundManager.instance.musicSource.Stop(); enabled = false; GameManager.instance.GameOver(source); return(true); } return(false); }
public void GameOver(GameOverSource source) { if (source == GameOverSource.MOVE) { levelText.text = "After " + level + " days, \n\nyou starved."; } else if (source == GameOverSource.ENEMY) { levelText.text = "After " + level + " days, \n\nyou were eaten alive."; } levelImage.SetActive(true); enabled = false; Invoke("LoadTitle", 6f); }
public static void SetGameOver(GameObject caller, GameOverSource source) { GameObject.Find("FlagManager").GetComponent <FlagManager>().gameIsOver = true; Text promptText = GameObject.Find("Prompt").GetComponent <Text>(); switch (source) { case GameOverSource.COLLISION: promptText.text = "You collided!"; break; case GameOverSource.SWERVE: promptText.text = caller.name + " swerved!"; break; } }
public void PlayGameOver() { GameOverSource.Play(); }