O'Reilly logo

Unity 3 Game Development HOTSHOT by Jate Wittayabundit

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Saving and loading the local high score

In this section, we will be creating two scripts for saving and loading the high score from our local machine. The first script will be the UsersData script, which will contain all the functions to save and load the score to our local machine by using the PlayerPrefs class. Then, we will create the LocalHiScore script, which will contain the function to sort user scores and check for the final score submission. Finally, we will go back to the HiScore script to create a LocalHiscore object to save and load high scores locally.

Prepare for Lift Off

Before we start, we need to know the basic parameters we need to include in the high-score table. We will need the order number, username, and the user score, as ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required