Ejemplo n.º 1
0
        private static void HandleNext_AllSequentially(Queue <Func <Promise> > queue, Deferred <object[]> masterDeferred, object[] args, int indexer)
        {
            if (queue.Count == 0)
            {
                masterDeferred.Resolve(args);
                return;
            }
            var promiseFunc = queue.Dequeue();

            promiseFunc()
            .Then(x =>
            {
                args[indexer] = x;
                HandleNext_AllSequentially(queue, masterDeferred, args, indexer++);
            })
            .Fail(x => masterDeferred.Reject(x));
        }
Ejemplo n.º 2
0
 public Promise(Deferred deferred)
 {
     Deferred = deferred;
 }
Ejemplo n.º 3
0
        private static IEnumerator WwwAsPromise_CoroutineHandler(WWW www, Deferred <WWW> deferred)
        {
            yield return(www);

            deferred.Resolve(www);
        }