-
-
Save todorok1/259272350a6ba397c1a6ff00fb0697b5 to your computer and use it in GitHub Desktop.
Start()をコルーチンとして呼ぶ
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() | |
{ | |
// コルーチンを開始します。 | |
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