Hi all, quick (and I hope straightforward) question concerning coroutines. I understand to have a list of coroutines, in which each is completed sequentially, you have this:
yield return StartCoroutine ( coroutineA() );
// Will only start, when the above has completed
yield return StartCoroutine ( coroutineB() );
However, my question is, if you have a reference to the coroutine (see below) how do I achieve the same as above (i.e. start coroutineB after coroutineA has completed).
Thanks!
Coroutine m_coroutine;
m_coroutine = StartCoroutine ( coroutineA() );
Yup, I understand that thanks - specifically, I was after a way to control them from (in your example) the Start() function - is that possible? Cheers
– AntLewisStart can also be an IEnumerator. Replace the void. IEnumerator Start () { yield return coroutineA(); yield return coroutineB(); } Maybe I'm misinterpreting what you mean, not really sure what you meant by "a way to control them.". If you mean, how to have coroutines execute sequentially in a normal function, then I'm not sure if that's possible.
– Jessespike