Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        time = Time.time;
        if (level != MissionDemolition.getLevel())
        {
            score = 1000;
        }
        score = score - (int)time;
        Text gt = this.GetComponent <Text>();

        gt.text = "Score lvl " + MissionDemolition.getLevel() + ": " + score;

        if ((1000 - score) > PlayerPrefs.GetInt(MissionDemolition.getLevel() + "HighScore"))
        {
            PlayerPrefs.SetInt(MissionDemolition.getLevel() + "HighScore", (1000 - score));
        }
    }