mirror of https://github.com/Cysharp/UniTask
Add requested stop all method
https://github.com/Cysharp/UniTask/issues/386 Original fix by fsener in the initial comment of the issuepull/451/head
parent
73d86259ce
commit
f760a2ae78
|
@ -510,6 +510,25 @@ namespace Cysharp.Threading.Tasks
|
|||
q.Enqueue(continuation);
|
||||
}
|
||||
|
||||
public static void StopAll()
|
||||
{
|
||||
IsEditorApplicationQuitting = true;
|
||||
|
||||
if (runners != null) {
|
||||
for (var i = 0; i < runners.Length; i++) {
|
||||
runners[i].Clear();
|
||||
}
|
||||
}
|
||||
|
||||
if (yielders != null) {
|
||||
for (var i = 0; i < yielders.Length; i++) {
|
||||
yielders[i].Clear();
|
||||
}
|
||||
}
|
||||
|
||||
IsEditorApplicationQuitting = false;
|
||||
}
|
||||
|
||||
// Diagnostics helper
|
||||
|
||||
#if UNITY_2019_3_OR_NEWER
|
||||
|
|
Loading…
Reference in New Issue