O'Reilly logo

Unity 4 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 server high score

In this section, we will create the ServerHiScore script to post and load the high score data from the server, which also inherits from the Hiscore class. We will use the WWWForm class to communicate with the PHP file on the website, which I already set up on my website. We will also use the hash key and encrypt it with MD5 encryption to protect and check for the user before posting the score to the database.

Prepare for lift off

Before we create the ServerHiScore script, we will take a look at this implementation of MD5 encryption, which is written by Matthew Wegner (http://www.unifycommunity.com/wiki/index.php?title=MD5).

If we go to the Project view, navigate to Chapter8 | Scripts | C# | Utils (for C# users) ...

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