LuukNoverraz / SumoShooters

A local multiplayer mobile game that mixes billiards with sumo. Made with the Unity Engine.
https://luuknoverraz.itch.io/sumo-shooters
3 stars 0 forks source link

Player coins not being set with player preferences for unknown reason #1

Open LuukNoverraz opened 4 years ago

LuukNoverraz commented 4 years ago
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.

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.

LuukNoverraz commented 4 years ago

Customization kleur