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

Commit

Permalink
Submitting now enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
pklaschka committed May 29, 2017
1 parent 6d53631 commit 21ab185
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Platformer_001/Assets/Scripts/Bestenliste/Bestenliste.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,27 @@ private void Start()
StartCoroutine(GetRank());
}

public void Submit()
public IEnumerator Submit()
{
// TODO: Implement submitting score
print("Submitting score: " + score + " (" + nameInput.text + ")");
WWWForm form = new WWWForm();
form.AddField("name", nameInput.text);
form.AddField("score", score);
form.AddField("scoreConfirmationString", scoreConfirmation);
var myWr = UnityWebRequest.Post(serverAdress + "/" + submitAdress, form);

yield return myWr.Send();

if (myWr.isError)
{
Debug.LogError("Submit has failed.");
}
else
{
PlayerPrefs.SetInt("maxSubmitedEndlosweite", score);
CheckSubmitable();
}
}

private IEnumerator GetRank()
Expand Down

0 comments on commit 21ab185

Please sign in to comment.