IEnumerator TestCoroutine() { print(this + "On TestCoroutine."); yieldreturnnewWaitForSeconds(0.1f); print("yield return 0.1 and start intextcoroutine On TestCoroutine."); Coroutine a = StartCoroutine(InTestCoroutine(0.4f)); var b = StartCoroutine(InTestCoroutine(0.8f)); var c = StartCoroutine(InTestCoroutine(1.2f)); yieldreturnnewWaitForSeconds(0.1f); print("yield return 0.1 On TestCoroutine."); yieldreturn a; yieldreturn b; yieldreturn c; print("yield return 0.1 On TestCoroutine. And finish this coroutine."); }
IEnumerator InTestCoroutine(float ft) { print(this + "On InTestCoroutine(" + ft + ")."); yieldreturnnewWaitForSeconds(0.1f); print("yield return 0.1 On InTestCoroutine(" + ft + ")."); yieldreturnnewWaitForSeconds(0.1f); print("yield return 0.1 On InTestCoroutine(" + ft + ")."); yieldreturnnewWaitForSeconds(ft); print("yield return " + ft + " On InTestCoroutine(" + ft + "). And finish this coroutine."); }