Beispiel #1
0
        public static Promise <T> WithAction <T>(Func <T> action)
        {
            var deferred = new Deferred <T>();

            deferred.action = action;
            return(deferred.RunAsync());
        }
        public static Promise <T> WithCoroutine <T>(Func <IEnumerator> coroutine)
        {
            var deferred = new Deferred <T>();

            deferred.coroutine = coroutine;
            return(deferred.RunAsync());
        }
Beispiel #3
0
        Deferred <T> createDeferredRescue(Action <Deferred <T> > setAction)
        {
            var deferred = new Deferred <T>();

            deferred._depth    = _depth;
            deferred._fraction = 1f;
            deferred.Progress(progress);
            setAction(deferred);
            addOnFulfilled(deferred.Fulfill);
            addOnFailed(error => deferred.RunAsync());
            addOnProgress(deferred.Progress);
            return(deferred);
        }
Beispiel #4
0
        public static Promise <T> WithCoroutine <T> (IEnumerator coroutine)
        {
            var deferred = new Deferred <T>();

            return(deferred.RunAsync(coroutine));
        }