Unity game communication with a 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:
Figure 10.22: Screenshot showing a Unity game retrieving scores from a web server
Getting ready
Since this scene contains several UI elements and the code of the recipe is the communication with the PHP scripts and SQL database, in the 10_09
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, perform the following steps:
- Create a new 2D Unity project.
- Import the Unity package provided,
UnityLeaderboardClient
. - Run the scene provided.
- Ensure that your PHP leaderboard is up and running.
- If you are not running locally (
localhost:8000
), you’ll need to update...