예제 #1
0
    public static void OnPlayerShipDestroyed()
    {
        StopGameTimer();

        isShowingDeathScreen = true;
        DeathScreen deathScreen = GameObject.Instantiate(deathScreenPrefab, Vector3.zero, Quaternion.identity).GetComponent <DeathScreen>();

        deathScreen.ShowDeathScreen();
    }
예제 #2
0
 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>();
 }
예제 #3
0
    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();
        }
    }