Hi. In my game for every second you survive you get a point. This is your score. You receive a score every time you play. You also have a high score. Now what I want to do is for every point you get you also get a coin. My problem is when I display your money amount on the menu it is just what you score last round. How can I make it so that your money amount is a collective total value of all your scores? Here is the code I am using to display your money amount which is the same as your score:
Saving the money amount:
PlayerPrefs.SetInt ("moneyAmount", score);
Displaying it:
private int moneyAmount;
public Text moneyamountLabel;
// Use this for initialization
void Start () {
moneyAmount = PlayerPrefs.GetInt ("moneyAmount");
moneyamountLabel.text = moneyAmount.ToString();
}
Any ideas? Thank you!