The documentation is a bit vague on this point, and I thought I'd ask on here before I went and blew my compiler up...
What happens when a coroutine is called which is already running?
e.g. say I have this code set up in a coroutine: (note: this requires other code to work, but it'll make the point)
what would happen if I had a function such as:
...and the invoking function was in a position to be called again before the coroutine finishes?
would it be more appropriate to do something like this?:
Basically what this comes down to is...will a new instance of a coroutine be created when it is called again or will it reset the existing one?
asked May 27 '11 at 04:33 AM
A new instance is created when it's called again.
answered May 27 '11 at 04:42 AM