// -----------------------------------------------------------------------// void SparringMatchSetup() { // Get rank & display in text box PlayerRank = PlayerPrefs.GetInt("PlayerRank"); rankText.GetComponent <Text>().text = "" + PlayerRank; if (PlayerRank >= 2) // player rank >=2 { GiveThisMuchEXP = SparringR2EXP; prefs.GainEXP(GiveThisMuchEXP); /* Kept for posterity * // Add current exp + granted exp * newEXP = PlayerEXP + GiveThisMuchEXP; * // Update playerprefs * // PlayerPrefs.SetInt("PlayerEXP", newEXP); * prefs.SavePref("PlayerEXP", newEXP); * * // Update player's total earned EXP * TotalEXP += GiveThisMuchEXP; * prefs.SavePref("TotalEXP", TotalEXP); */ } if (PlayerRank == 1) { GiveThisMuchEXP = SparringR1EXP; prefs.GainEXP(GiveThisMuchEXP); } expText.GetComponent <Text>().text = "+" + GiveThisMuchEXP + "\n" + PlayerEXP; }
public void testEXPgain() { // PlayerPrefs.SetInt("PlayerEXP", PlayerEXP+1000); prefs.GainEXP(1000); cheapoUpdate(); }