Quantcast
Channel: Answers by "TheCatProblem"
Viewing all articles
Browse latest Browse all 28

Answer by TheCatProblem

$
0
0
By "return control to Unity" the documentation is referring to the fact that coroutines are non-blocking (when one is called within a piece of code using `StartCoroutine()`, the calling code doesn't wait for the coroutine to finish before continuing).> My understanding is that if I start a coroutine inside Update(), any code after the function call inside Update is not executed until the coroutine completes. This is incorrect because of the aforementioned "return control to Unity" behaviour. (The documentation should really say something like "return control to the function that called it"; just saying that control is returned to Unity as a whole is rather vague.) Any code after the coroutine call will be executed immediately after the coroutine is started (even if there is a delay in the coroutine itself). If you're interested in low-level details, [this blog post][1] (archived, as the site seems to be down at the moment) may be of interest. Hope that helps! [1]: http://web.archive.org/web/20140719082851/http://www.altdev.co/2011/07/07/unity3d-coroutines-in-detail/

Viewing all articles
Browse latest Browse all 28

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>