Can anyone help me with the coin calculation.
After completing the level I run this code to add the coins to total coins.
Totalcoins is used for IAP purposes.
However everytime i retry the level the it keeps resetting the total coins value.
Thanks in advance for the solution.
if (coins > 0)
{
totalcoins += coins;
PlayerPrefs.SetInt("Total Coins", totalcoins);
//print(PlayerPrefs.GetInt("Total Coins"));
print(totalcoins);
}