Unity game communication with web-server leaderboard
In this recipe, we create a Unity game Client that can communicate, via UI buttons, with our web server leaderboard from the previous recipe:

Getting ready
Since the scene contains several UI elements and the code of the recipe is the communication with the PHP scripts and SQL database, in the 12_02
folder, we have provided a Unity package called UnityLeaderboardClient
, containing a scene with everything set up for the Unity project.
How to do it...
To create a Unity game that communicates with the web-server leaderboard, do the following:
- Import the provided Unity package,
UnityLeaderboardClient
. - Run the provided Scene.
- Ensure your PHP leaderboard is up and running.
- If you are not running locally (
localhost:8000
), you'll need to update the URL by selecting the Main Camera in the Hierarchy, and then editing the Leader Board URL text for the Web Leaderboard (Script) component in the Inspector:

- Click on the UIButtons to make Unity communicate with...