dimanche 31 janvier 2016

Yield

I came across a code in Unity's scripting guide:

    www = new WWW("SomeDirectFileUrl");
    yield www;
    newestVersion = www.text;

Called in a coroutine, I undertand the yield is used to put the method on standby until a condition is met (like waitForSeconds, or simply for a frame), but it simply passes an instance as a parameter, not a condition... So i'd really like to know how it works, and what is the program waiting after (since only a mere instance of a class was passed as a parameter, not an order),and I'd also like to know if you can actually ask the program to wait until a condition is true. Thanks a lot! -Alex




Aucun commentaire:

Enregistrer un commentaire