For a while, I was searching for a way of using yield WaitForSeconds within an ‘eval’ block.
I found a way to do that, so I thought I’d share it:
var myCall:Function = null;
eval(data);
StartCoroutine(myCall() as IEnumerator);
[source 'data']
myCall = function() {
print("hello world");
yield WaitForSeconds(2);
print("bye bye");
}
Hopefully it helps someone in the future!