if (!PlayerPrefs.HasKey("Sumocoins"))
{
PlayerPrefs.SetInt("Sumocoins", 0);
}
if (PlayerPrefs.HasKey("Sumocoins"))
{
currentSumocoins = PlayerPrefs.GetInt("Sumocoins", 0);
}
Here in the void Start() function the variable currentSumocoins is set to the amount of Sumocoins the player currently has. If the player does not have a key, the preference will be set to zero.
Here in the
void Start()
function the variablecurrentSumocoins
is set to the amount of Sumocoins the player currently has. If the player does not have a key, the preference will be set to zero.PlayerPrefs.SetInt("Sumocoins", (currentSumocoins + 1));
This line is called when either of the players win, setting the Sumocoins in the player preferences to the current amount of Sumocoins plus one.
This feature is currently not working and the cause has not yet been identified.
Debugging has yet to be done.