- Home /
Local High-Scores with PlayerPrefs?
Hi there guys, so my latest IOS project is going to have a very basic High-Scores scene. It is going to be something like this:
Player1..........999
Player2..........888
Player3..........777
Player4..........666
Player5..........555
I want the scene to display only the highest 5 scores achieved (locally).
After the user plays a round and looses, the game over screen pops with a text field to enter your name, that name is then saved with the player score using PlayerPrefs and displayed with GUI on my high scores scene, everything fine up to this point.
What i want to achieve is every time the user plays, the "new score" is added to the leaderboard, until it has five scores saved, then it will just add the scores that are higher to one of the previously saved scores, there is a perfect example of what i am looking for here and I found a similar question here, the replies are about something called ArrayPrefs2 but i don´t know if this is the right approach or if I am just making this harder than it should be. Any ideas?
Thanks for the help!
check this answer !! http://answers.unity3d.com/questions/252209/high-score-list.html
I checked that one before and it works really good, but my game is written is js and i wasn´t able to rewrite that script.