Hi,
I’m trying to add yield when the highscore is posted with C#.
This what I’ve tried.
postScore(playerName, playerScore);
IEnumerator postScore(string name, int score)
{
string hash=Md5Sum(name + score + secretKey);
string highscore_url = addScoreUrl + "name=" + WWW.EscapeURL(name) + "&score=" + score + "&hash=" + hash";
WWW hs_post = new WWW(highscore_url);
yield return hs_post;
if(hs_post.error == null)
{
print("There was an error posting the high score: " + hs_post.error);
}
}
The yield return hs_post; here doesn’t seem to work. So somehow I would need this to wait until the score is posted to the server and get error message if there is an error.