I’m unfamiliar with coroutines and yield. Is there a comprehensive tutorial on these things that explains how to use them and why you would use them.
http://unity3d.com/support/documentation/ScriptReference/index.Coroutines_26_Yield.html
This is okay but I’m confused about what the output would be in the examples. They should write out the order of what the user would see if they run the code.
Questions
function function2(){
Debug.Log("I am in function2");
}
function function1(){
Debug.Log("hello");
yield function2()
Debug.Log("goodbye");
}
What would this do if function1 is called. Would it
A) wait until function2 runs and then go back to function1?
B)just wait a frame. or would it not
C) Jump out of function1 never to return unless it’s called again.
D) Delay the update function until function2 is done?
Confused about how to use these in general.
I have one application where I have a long running for loop and I want to be able to break out if it is not going well. Would yield help me with that?
Thanks,
Dan