Skip to content
This repository has been archived by the owner on Dec 28, 2019. It is now read-only.

Commit

Permalink
Best 5 Anzeige
Browse files Browse the repository at this point in the history
  • Loading branch information
pklaschka committed May 28, 2017
1 parent 355e995 commit ca16009
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions Platformer_001/Assets/Scripts/Bestenliste/Bestenliste.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ private void Start()
score = PlayerPrefs.GetInt("maxEndlosweite", 0);
scoreConfirmation = PlayerPrefs.GetString("maxEndlosweiteConfirmation", "");

SetupBestenliste();
StartCoroutine(SetupBestenliste());

StartCoroutine(GetRank());
}
Expand All @@ -38,9 +38,7 @@ public void Submit()

private IEnumerator GetRank()
{
// TODO: Implementation of Rank
var myWr = UnityWebRequest.Get(serverAdress + "/" + rankAdress + score);
//myWr.SetRequestHeader();
yield return myWr.Send();

if(myWr.isError) {
Expand All @@ -53,14 +51,19 @@ private IEnumerator GetRank()
}
}

private void SetupBestenliste()
private IEnumerator SetupBestenliste()
{
bestenliste.text = "<b>Die Besten:</b>\n" +
"1. Karl (51683)\n" +
"2. Karl (31555)\n" +
"3. Karl (3013)\n" +
"4. Karl (687)\n" +
"5. Karl (311)\n";
bestenliste.text = "<b>Die Besten:</b>\n";
var myWr = UnityWebRequest.Get(serverAdress + "/" + best5Adress);
yield return myWr.Send();

if(myWr.isError) {
Debug.LogError(myWr.error);
}
else {
bestenliste.text = "<b>Die Besten:</b>\n" + myWr.downloadHandler.text;
}

}

public void OpenBestenliste()
Expand Down

0 comments on commit ca16009

Please sign in to comment.