To create a Unity game that communicates with the web server leaderboard, perform the following steps:
- 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 the URL by selecting Main Camera in the Hierarchy window, and then editing the Leader Board URL text for the Web Leader Board (Script) component in the Inspector window:
Figure 8.7 – Setting a website URL public variable in the Inspector window
- Click on UI Buttons to make Unity communicate with the PHP scripts that have access to the high-score database.