Game Development Reference
In-Depth Information
…
}
if (GUI.Button(_buttonRect3, "SERVER HI-SCORE")) {
_serverHiscore.LoadUserData();
_page = PAGE.SERVERSCORE;
}
}
// C# user:
…
void Gameover ()
{
…
if (_clickSubmit == false) {
…
if (GUI.Button(_buttonRect1, "SUBMIT")) {
…
_localHiscore.SaveUserData(_user);
_serverHiscore.SaveUserData(_user);
}
}
if (GUI.Button(_buttonRect2, "LOCAL HI-SCORE")) {
…
}
if (GUI.Button(_buttonRect3, "SERVER HI-SCORE")) {
_serverHiscore.LoadUserData();
_page = PAGE.SERVERSCORE;
}
}
9. At last, we will go to the
ServerHiscore()
function to add the code to show
the high score table data, as shown in the following highlighted code:
// Unity JavaScript user:
…
private function ServerHiscore ()
{
CreateBackgroundBox("SERVER HI-SCORE");