We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CoroutineManagerに、コルーチン実行時の制御を細かく指定できるようAPIを拡張したい
CoroutineManager#Start の第二引数に文字列を指定した場合、コルーチンが名前付きで実行される。 そのままでは特に意味を為さないが、後述する機能のために用いる。
CoroutineManager#Start
CoroutineManager _coroutine; _coroutine.Start(Say("Hello"), nameof(Say));
CoroutineManager#Start の第三引数に CoroutineCreateOption 列挙体を指定することで、同じ名前のコルーチンが既に実行されている場合の挙動を制御できる。
CoroutineCreateOption
enum CoroutineDuplicateFlag { Ignore, // 既存の挙動。重複を許可する。 StopExists, // 重複する名前のコルーチンを削除してから実行する。 Cancel, // 実行をキャンセルする。 Throw, // 例外をスローする。 Enqueue, 同名のコルーチンの実行が終わった後に実行する。 } _coroutine.Start(Say("Hello"), nameof(Say), CoroutineDuplicateFlag.StopExists);
var c = _coroutine.Start(Say("Hello")); _coroutine.Pause(c); // 一時停止 _coroutine.Resume(c); // 再実行
// 渡したコルーチンを起動し、全て完了するまで待機するコルーチンを起動する。 var waitAll = _coroutine.WaitAll([ DownloadTask("/data1"), DownloadTask("/data2"), ]); // 渡したコルーチンを起動し、どれか1つが完了するまで待機するコルーチンを起動する。 var waitAny = _coroutine.WaitAny([ DownloadTask("/data1"), DownloadTask("/data2"), ]);
// 渡した順番にコルーチンを起動する処理をもつ、新たなコルーチンを起動する var sequence = _coroutine.Sequence([ Say("Hello"), Nod(), Say("This is a test of coroutine"), Nod(), ]);
The text was updated successfully, but these errors were encountered:
時間ベースのYieldInstructionが、一時停止したときにおかしな挙動をしそう どうしよう?
Sorry, something went wrong.
No branches or pull requests
CoroutineManagerに、コルーチン実行時の制御を細かく指定できるようAPIを拡張したい
名前付きコルーチン
CoroutineManager#Start
の第二引数に文字列を指定した場合、コルーチンが名前付きで実行される。そのままでは特に意味を為さないが、後述する機能のために用いる。
コルーチン実行モード
CoroutineManager#Start
の第三引数にCoroutineCreateOption
列挙体を指定することで、同じ名前のコルーチンが既に実行されている場合の挙動を制御できる。コルーチンの一時停止と再実行
コルーチンの同時実行
コルーチンの順次実行
The text was updated successfully, but these errors were encountered: