I have this simple question. If you execute this: what will happen? Because i debbug it and it seems it continue executing, but it nere restarts, can someone explain me how it works a little better?
if (something) // THINGS A
// THINGS B
yield return new WaitForSeconds(3));
I wil never restart itself due that StopAllCoroutines, right=? Or What ?
Thanks in advance
StopAllCoroutines will kill any instructions that are suspended by a
yield instruction. In the simplest case:
IEnumerator Deambular ()
yield return null;
will only print
You should not call
StapAllCoroutines() inside a coroutine. Do it before, it will stop all coroutines, theb if you start another one it will not be affected. If you want to stop a coroutine from inside, you can use
yield break instead