/WaitSampleStart.cs Secret
Created
September 20, 2020 05:24
Star
You must be signed in to star a gist
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