Exemplo n.º 1
0
    public void endOfGame()
    {
        //ADS.ShowAd ();
        ended           = true;
        Timer.text      = "OUT OF TIME";
        centerText.text = "Game Over\nScore " + Score + "\nHigh Score " + PlayerPrefs.GetInt("raceHighScore") + "\nRestart or Exit?";

        if (Score > PlayerPrefs.GetInt("raceHighScore"))
        {
            PlayerPrefs.SetInt("raceHighScore", Score);
        }

        Debug.Log(PlayerPrefs.GetInt("raceHighScore"));

        pauseManager.End();
        Time.timeScale = 0;
        if (amAndroid)
        {
            body.GetComponent <ShipTiltAndroid> ().enabled = false;
        }
        else
        {
            body.GetComponent <ShipTilt> ().enabled = true;
        }
    }