Hello, so I am creating a game that rewards a star when a certain score is reached. If the player reached 15 points he gets 1 star and when the score increases to 50 points he gets another 2 stars and when he reached 70 points he gets another 3 (so 5 stars will be added to his current stars). And then the stars he collected will be saved. Please help me how can I implements that scenario I have tried some codes but doesn’t work well.
Here is my current code:
if (Score == 15)
{
starAmount += 1;
starC.text = starAmount.ToString();
}
if (Score == 50)
{
starAmount += 2;
starC.text = starAmount.ToString();
}
if (Score == 70)
{
starAmount += 3;
starC.text = starAmount.ToString();
}
if (starAmount > PlayerPrefs.GetFloat("stars", 0))
{
PlayerPrefs.SetFloat("stars", starAmount);
starC.text = starAmount.ToString();
}