public void testRankUp() { if (PlayerRank > 0) { // PlayerPrefs.SetInt("PlayerRank", PlayerRank - 1); prefs.SavePref("PlayerRank", (PlayerRank - 1)); PlayerRank = PlayerPrefs.GetInt("PlayerRank"); cheapoUpdate(); } }
// -----------------------------------------------------------------------// void TrueMatchSetup() { if ((PlayerRank - 1) > 0) // New Player Rank will be > 0 (ie. hasn't won game yet.) { // Decrease rank as player wins PlayerRank--; // Save rank across scenes // PlayerPrefs.SetInt("PlayerRank", PlayerRank); prefs.SavePref("PlayerRank", PlayerRank); if (PlayerRank == 2) // player goes 3->2 { GiveThisMuchEXP = MatchR2EXP; prefs.GainEXP(MatchR2EXP); } if (PlayerRank == 1) { GiveThisMuchEXP = MatchR1EXP; prefs.GainEXP(MatchR1EXP); } expText.GetComponent <Text>().text = "+" + GiveThisMuchEXP + "\n" + PlayerEXP; } else if (PlayerRank > 3) { Debug.Log("PLAYER RANK IS TOO HIGH; SOMETHING BROKEN"); } else // New Player rank 0 ie <1 { rankText.GetComponent <Text>().text = ""; expText.GetComponent <Text>().text = ""; // Player Beat Game! prefs.SavePrefBool("BeatGame", true); // PlayerPrefs.SetInt("BeatGame", 1); // Load Beat Game Scene (no delay) sceneChanger.GoSceneNumber(2); } }