Esempio n. 1
0
    void GameOver()
    {
        stick.SetActive(false);
        if (PlayerPrefs.GetString("Controls") == "DPad")
        {
            dpad.SetActive(false);
        }
        CancelInvoke();
        SetScore();
        updateHighScore(score);
        stop.moveEnabled = false;
        lives            = 0;
        int coinAdd = 5 + (score / 10);

        PlayerPrefs.SetInt("Total_Coins", PlayerPrefs.GetInt("Total_Coins") + coinAdd);
        PlayerPrefs.SetInt("Total_Classicsnake_Games_Played", PlayerPrefs.GetInt("Total_Classicsnake_Games_Played") + 1);
        achScr.AchSeven();
        achScr.AchEight();
        achScr.AchNine();
        achScr.AchTen();
        wordCount = 0;
        anim.SetTrigger("GameOver");
        PlayAd();
    }