Exemplo n.º 1
0
    public void Win()
    {
        //win condition
        winCanvas.enabled = true;
        //figure out star allotment
        int stars = 1;

        if (numStars == totalStars)
        {
            stars = 3;
        }
        else if (((float)numStars / (float)totalStars) >= 0.9f)
        {
            stars = 2;
        }
        int check = SceneManager.GetActiveScene().buildIndex;

        check -= 3;
        PrefStatsScript.checkMax(check, stars);
        GameObject.Find("StarWinText").GetComponent <Text>().text = stars.ToString() + " Stars!";
    }
 // Use this for initialization
 void Start()
 {
     PrefStatsScript.SetPlayerPrefs();
 }