예제 #1
0
    void GameOver()
    {
        Debug.Log("Game Over");

        // Stop all kinds of stuff
        spawner.stop             = true;
        scoreManager.stop        = true;
        tutorialTextManager.stop = true;

        // Stop moving the landscape
        laneProperties.speed       = 0;
        laneProperties.effectSpeed = 0;
        laneProperties.accerlerate = false;

        // Stop moving the dinosuar
        dinosaur.GetComponent <Rigidbody>().isKinematic = false;
        ParticleSystem.EmissionModule e = dinosaur.GetComponentInChildren <ParticleSystem>().emission;
        e.enabled = false;
        dinosaur.GetComponentInChildren <PlayerController>().stop = true;

        // Check if new high score is achieved
        if (ScoreManager.score * 10 > RankingManager.GetWorstScore())
        {
            hiScoreScreen.SetActive(true);
            gameObject.GetComponent <NewHiScore>().Focus();
        }
        else
        {
            endScreen.SetActive(true);
        }
    }