Skip to content

Instantly share code, notes, and snippets.

@takashicompany
Last active August 29, 2015 14:03
Show Gist options
  • Save takashicompany/4c5cdacc91ede8323f77 to your computer and use it in GitHub Desktop.
Save takashicompany/4c5cdacc91ede8323f77 to your computer and use it in GitHub Desktop.
コールバックを使わずに、親クラスが子クラスのアニメーションや処理の終了を取得するサンプル
public Child child;
private IEnumerator StartPlay()
{
child.Play();
while (!child.isComplete)
{
// childのisComplete変数がtrueになるまで待機
yield return new WaitForEndOfFrame();
}
// childのアニメーションが終了したとき
// (child.isCompleteがtrueになったとき)
// ここより下にかかれた処理が実行される
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment