[Solved] High score Unity C# [closed]


Please try Google before asking a question here…

(StackExchange rule: Don’t ask about questions you haven’t tried to find an answer for) – e.g. http://answers.unity3d.com/questions/672869/player-prefs-to-store-high-scores.html

If your actual question is how to save a highscore, use PlayerPrefs.

For example, to save a highscore for later (every time you reached a new score, e.g. at the end of the game):

if(score > PlayerPrefs.GetInt("HighScore", 0)) {
    PlayerPrefs.SetInt("HighScore", score);
    PlayerPrefs.Save();
}

And to read it (in a Start() or Awake() method in your Main Menu), put

SomeHighScoreUIText.text = PlayerPrefs.GetInt("HighScore", 0);

7

solved High score Unity C# [closed]