LoginSignup
14
13

More than 5 years have passed since last update.

コルーチンの中で別のコルーチンの終了を待つ

Posted at

コルーチンの中で、更にWWWなどを使うメソッドを呼び出したい場合。

routine.cs

void Start(){
  StartCoroutine(Routine1());
}

IEnumerable Routine1(){
  yield return StartCoroutine(Routine2()); //yield return付けないと非同期になる
}

IEnumerable Routine2(){
  WWW www = new WWW("hogehoge");
  yield return www;
}

14
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
13