/// <summary> Resumers managed routines that are waiting for next frame. </summary> public void Update() { foreach (var resumer in nextFrameResumers) { resumer.Resume(); } nextFrameResumers.Clear(); //Cleanup dead routines var _maxRoot = maxRoot; maxRoot = -1; for (var i = 0; i <= _maxRoot; ++i) { var root = roots[i]; if (root == null) { continue; } if (root.IsDead) { roots[i] = null; CTask.Release(root); } else { maxRoot = i; } } }
/// <summary> Stops all managed routines. </summary> public void StopAll() { for (var i = 0; i < roots.Count; ++i) { if (roots[i] == null) { continue; } CTask.Release(roots[i]); roots[i] = null; } }