Hello, I am trying to store a different high score in each level but with my script it uses the same high score in all levels.
Script that I am using now:
public void SetCountText ()
{
countText.text = "Score: " + count;
if (count > PlayerPrefs.GetInt ("BestScore"))
{
PlayerPrefs.SetInt ("BestScore", count);
}
}
From the gameover scene:
public void Score()
{
scoreText.text = "Score: " + playerController.count;
score = playerController.count;
if (score > PlayerPrefs.GetInt ("BestScore"))
{
PlayerPrefs.SetInt ("BestScore", score);
}
}
public void BestScore()
{
bestScoreText.text = "Best: " + PlayerPrefs.GetInt ("BestScore");
}