public static void OnPlayerShipDestroyed() { StopGameTimer(); isShowingDeathScreen = true; DeathScreen deathScreen = GameObject.Instantiate(deathScreenPrefab, Vector3.zero, Quaternion.identity).GetComponent <DeathScreen>(); deathScreen.ShowDeathScreen(); }
void Start() { player = FindObjectOfType <Player>(); scoreAdditionSpawnPosition = scoreAddition; multiplierDisplay = FindObjectOfType <MultiplierDisplay>(); scoreDisplay = FindObjectOfType <ScoreDisplay>(); dead = false; audioManager = FindObjectOfType <AudioManager>(); deathScreen = FindObjectOfType <DeathScreen>(); deathScreen.ShowDeathScreen(false); pauseMenu = FindObjectOfType <PauseMenu>(); }
public void Death() { if (godMode == false) { dead = true; //hvis vi gerne vil fortælle spilleren score inden reset int yourScore = this.score; if (scoreBest < yourScore) { scoreBest = yourScore; } //show yourScore and scoreBest with big numbers in middle of screen!! deathScreen.ShowDeathScreen(true); scoreDisplay.gameObject.SetActive(false); multiplierDisplay.gameObject.SetActive(false); player.TriggerDeathAnim(); } }