/// <summary> /// Outer waiter-- Will cb if cancelled /// </summary> public static void WaitThenCBEvenIfCancelled(CoroutineRegularUpdater Exec, ICancellee cT, float time, bool zeroToInfinity, Action cb) { cT.ThrowIfCancelled(); if (zeroToInfinity && time < float.Epsilon) { time = float.MaxValue; } Exec.RunRIEnumerator(WaitFor(time, cT, cb)); }
/// <summary> /// Outer waiter-- Will not cb if cancelled /// </summary> public static void WaitThenCB(CoroutineRegularUpdater Exec, ICancellee cT, float time, Func <bool> condition, Action cb) { cT.ThrowIfCancelled(); Exec.RunRIEnumerator(WaitForBoth(time, condition, cT, () => { if (!cT.Cancelled) { cb(); } })); }
/// <summary> /// Outer waiter-- Will not cancel if cancelled /// </summary> public static void WaitThenCancel(CoroutineRegularUpdater Exec, ICancellee cT, float time, bool zeroToInfinity, Cancellable toCancel) { cT.ThrowIfCancelled(); if (zeroToInfinity && time < float.Epsilon) { time = float.MaxValue; } Exec.RunRIEnumerator(WaitFor(time, cT, () => { if (!cT.Cancelled) { toCancel.Cancel(); } })); }