I’ve searched around, and everything I’ve found says to yield the stream so unity automatically waits for it to load, however whenever I try it, either locally in-editor or on my server, it doesn’t do anything.
function LoadScores()
{
var postData:WWWForm = new WWWForm();
// add post variables
var webData:WWW = new WWW(url, postData);
yield webData;
// parse the returned data from webData.text
}
Also, my understanding of the yield keyword means that the function would need to be called repeatedly untill the scores are loaded, as the function starts from the following line the next time it’s called. Is this correct?
Thanks in advance.
EDIT:
Just tried this, but still not working.
function LoadScores()
{
var postData:WWWForm = new WWWForm();
// add post variables
var webData:WWW = new WWW(url, postData);
while (!webData.isDone)
{
yield webData;
}
// parse the returned data from webData.text
}