private IEnumerator DebugAfterDelay(IPendingPromise promise) { yield return(new WaitForSeconds(Delay)); UnityEngine.Debug.Log(DebugString); promise.Resolve(); }
private IEnumerator DoCleanup(IPendingPromise promise) { yield return(new WaitForSeconds(CleanAfterSeconds)); if (BPauseFlowForClean) { promise.Resolve(); } Destroy(_instance); }
private static IEnumerator Await(this AsyncOperation operation, IPendingPromise promise, string sceneName, bool debugMeOnLoad) { var timer = new Stopwatch(); timer.Start(); while (!operation.isDone) { yield return(operation); } if (debugMeOnLoad) { timer.Stop(); Debug.Log($"<color=green>⬤</color> Load <color=orange>{sceneName}</color> took: <color=white>{timer.Elapsed.Milliseconds}</color>ms"); } promise.Resolve(); }
private static IEnumerator WaitUntilAsPromise(Func <bool> evaluator, IPendingPromise <Object> p) { yield return(new WaitUntil(evaluator)); p.Resolve(null); }
private IEnumerator WaitForSeconds(IPendingPromise promise) { yield return(new WaitForSeconds(Wait)); promise.Resolve(); }