Example #1
0
    // Use this for initialization
    void Start()
    {
        isHighScore          = false;
        newHighScore.enabled = false;
        score         = PlayerPrefs.GetInt("score");
        timeRemaining = TimeTracker.getFinalTime();

        bonusPercent = timeRemaining / 300;
        multiplier   = 1 + bonusPercent;
        finalScore   = (int)(multiplier * score);
        PlayerPrefs.SetInt("score", finalScore);
        ScoreTracker.setScore(finalScore);

        GetComponent <AudioSource> ().clip = music;
        GetComponent <AudioSource> ().Play();

        Invoke("CalculateScore", 3);
    }