Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 3
0
        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();
        }
Ejemplo n.º 4
0
        private static IEnumerator WaitUntilAsPromise(Func <bool> evaluator, IPendingPromise <Object> p)
        {
            yield return(new WaitUntil(evaluator));

            p.Resolve(null);
        }
Ejemplo n.º 5
0
        private IEnumerator WaitForSeconds(IPendingPromise promise)
        {
            yield return(new WaitForSeconds(Wait));

            promise.Resolve();
        }