Beispiel #1
0
    void GameOver()
    {
        //게임 오버
        if (!Stop)
        {
            BirdSound_3.Play();
        }

        Stop = true;
        Floor.GetComponent <Animator>().enabled = false;
        White.SetActive(true);
        Score.gameObject.SetActive(false);
        if (PlayerPrefs.GetInt("BestScore", 0) < int.Parse(Score.text))
        {
            PlayerPrefs.SetInt("BestScore", int.Parse(Score.text));
        }

        if (transform.position.y < -2.55f)
        {
            Quit.SetActive(true);
            Quit.transform.Find("ScoreScreen").GetComponent <Text>().text = Score.text;
            Quit.transform.Find("BestScreen").GetComponent <Text>().text  = PlayerPrefs.GetInt("BestScore").ToString();
        }
    }