Last active
January 11, 2016 13:50
-
-
Save neruca/56a4719e1b0c083951cf to your computer and use it in GitHub Desktop.
Unity Coroutine Question Answer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IEnumerator Start () { // Start() の戻り値を IEnumerator 型にする! | |
Debug.Log ("CountStart !!"); | |
Coroutine count1To5 = StartCoroutine (CountFrame1To5 ()); // StartCoroutine()の戻り値を一度Coroutine型に代入する! | |
Coroutine count201To205 = StartCoroutine (CountFrame201To205 ()); // 同上 | |
yield return count1To5; // コルーチン終了まで待つ | |
yield return count201To205; // コルーチン終了まで待つ | |
Debug.Log ("CountEnd !!"); // 意図した通り、最終行に出力される!! | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment