Skip to content

Instantly share code, notes, and snippets.

@todorok1
Created September 20, 2020 05:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save todorok1/259272350a6ba397c1a6ff00fb0697b5 to your computer and use it in GitHub Desktop.
Save todorok1/259272350a6ba397c1a6ff00fb0697b5 to your computer and use it in GitHub Desktop.
Start()をコルーチンとして呼ぶ
IEnumerator Start()
{
// コルーチンを開始します。
yield return StartCoroutine(WaitProcess());
}
/// <Summary>
/// コルーチンで処理を待ちます。
/// </Summary>
IEnumerator WaitProcess()
{
// 1フレーム処理を待ちます。
yield return null;
// 指定した秒数だけ処理を待ちます。(ここでは1.0秒)
yield return new WaitForSeconds(1.0f);
// 別のコルーチンの終了を待ちます。
yield return StartCoroutine(AnotherProcess());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment