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()); }
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); }
public static Promise <T> WithCoroutine <T> (IEnumerator coroutine) { var deferred = new Deferred <T>(); return(deferred.RunAsync(coroutine)); }