public static UniTask WhenAll(IEnumerable <UniTask> tasks) { using (var span = ArrayPoolUtil.Materialize(tasks)) { var promise = new WhenAllPromise(span.Array, span.Length); // consumed array in constructor. return(new UniTask(promise, 0)); } }
public static async UniTask WhenAll(IEnumerable<UniTask> tasks) { WhenAllPromise promise; using (var span = ArrayPoolUtil.Materialize(tasks)) { promise = new WhenAllPromise(span.Array, span.Length); } await promise; }
public static async UniTask<T[]> WhenAll<T>(IEnumerable<UniTask<T>> tasks) { WhenAllPromise<T> promise; using (var span = ArrayPoolUtil.Materialize(tasks)) { promise = new WhenAllPromise<T>(span.Array, span.Length); } return await promise; }