Hi
At the moment I have a high-score that is run on each level, it is attached to my main character:
if (PlayerPrefs.GetInt ("highScore") < PlayerPrefs.GetInt("Score") ) {
PlayerPrefs.SetInt ("highScore",(int)(playerScore * 100));
}
I then call it in the game over scene:
highScore = PlayerPrefs.GetInt ("highScore");
At the moment the high-score is for the highest score in the game overall. I want to make the high-scores for each individual level.
I’m not sure on how to do this.
I had though it might be similar to the way i have done the restart level button, i have this script:
public static class LevelManager
{
private static string lastLevel;
public static void setLastLevel(string level)
{
lastLevel = level;
}
public static string getLastLevel()
{
return lastLevel;
}
public static void changeToPreviousLvl()
{
Application.LoadLevel(lastLevel);
}
}
and then i call :
Application.LoadLevel(LevelManager.getLastLevel());
when i want to go back to the last scene.
I’m not sure if there is a similar way to do it with scores.
Thanks