Exemplo n.º 1
0
 public static void beatLevel(int i)
 {
     if (i <= MaxLevel)
     {
         PlayerPrefs.SetInt("Level " + i, 1);
         print("coins is " + PlayerStats.Coins);
         winp.setCoins(PlayerStats.Coins);
         print("score is " + PlayerStats.Score);
         winp.setScore(PlayerStats.Score);
         if (PlayerPrefs.GetInt("Level " + i + " coins", 0) < PlayerStats.Coins)
         {
             PlayerPrefs.SetInt("Level " + i + " coins", PlayerStats.Coins);
             winp.setBestCoins(PlayerStats.Coins);
         }
         else
         {
             winp.setBestCoins(PlayerPrefs.GetInt("Level " + i + " coins", 0));
         }
         if (PlayerPrefs.GetInt("Level " + i + " score", 0) < PlayerStats.Score)
         {
             PlayerPrefs.SetInt("Level " + i + " score", PlayerStats.Score);
             winp.setHighscore(PlayerStats.Score);
         }
         else
         {
             winp.setHighscore(PlayerPrefs.GetInt("Level " + i + " score", 0));
         }
     }
 }