Exemple #1
0
 void Awake()
 {
     if (PersistentScoreInstance == null)
     {
         PersistentScoreInstance = gameObject.GetComponent <PersistentScore>();
     }
 }
Exemple #2
0
    // Use this for initialization
    void Start()
    {
        int lv1 = PersistentScore.getHighScore(1);
        int lv2 = PersistentScore.getHighScore(2);

        highscoreLv1.text = "Score: " + lv1.ToString();
        highscoreLv2.text = "Score: " + lv2.ToString();
    }
Exemple #3
0
    private void GameOver()
    {
        PlayerPrefs.SetInt("Score", Score);
        string finishStatus = isFinishReached ? "true" : "false";

        PlayerPrefs.SetString("finishStatus", finishStatus);
        if (isFinishReached)
        {
            PersistentScore.addHighScore(level, Score);
        }
        Application.LoadLevel(3);
    }