Merge remote-tracking branch 'origin/master'

master
neuecc 2020-09-15 06:35:28 +09:00
commit a40f89a922
3 changed files with 30 additions and 4 deletions

View File

@ -14,7 +14,8 @@ Provides an efficient allocation free async/await integration to Unity.
* Highly compatible behaviour with Task/ValueTask/IValueTaskSource * Highly compatible behaviour with Task/ValueTask/IValueTaskSource
Techinical details, see blog post: [UniTask v2 — Zero Allocation async/await for Unity, with Asynchronous LINQ Techinical details, see blog post: [UniTask v2 — Zero Allocation async/await for Unity, with Asynchronous LINQ
](https://medium.com/@neuecc/unitask-v2-zero-allocation-async-await-for-unity-with-asynchronous-linq-1aa9c96aa7dd) ](https://medium.com/@neuecc/unitask-v2-zero-allocation-async-await-for-unity-with-asynchronous-linq-1aa9c96aa7dd)
Advanced tips, see blog post: [Extends UnityWebRequest via async decorator pattern — Advanced Techniques of UniTask](https://medium.com/@neuecc/extends-unitywebrequest-via-async-decorator-pattern-advanced-techniques-of-unitask-ceff9c5ee846)
<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

View File

@ -732,7 +732,7 @@ namespace Cysharp.Threading.Tasks
return await await task; return await await task;
} }
public static async UniTask Unwrap<T>(this UniTask<UniTask> task) public static async UniTask Unwrap(this UniTask<UniTask> task)
{ {
await await task; await await task;
} }
@ -741,22 +741,42 @@ namespace Cysharp.Threading.Tasks
{ {
return await await task; return await await task;
} }
public static async UniTask<T> Unwrap<T>(this Task<UniTask<T>> task, bool continueOnCapturedContext)
{
return await await task.ConfigureAwait(continueOnCapturedContext);
}
public static async UniTask Unwrap<T>(this Task<UniTask> task) public static async UniTask Unwrap(this Task<UniTask> task)
{ {
await await task; await await task;
} }
public static async UniTask Unwrap(this Task<UniTask> task, bool continueOnCapturedContext)
{
await await task.ConfigureAwait(continueOnCapturedContext);
}
public static async UniTask<T> Unwrap<T>(this UniTask<Task<T>> task) public static async UniTask<T> Unwrap<T>(this UniTask<Task<T>> task)
{ {
return await await task; return await await task;
} }
public static async UniTask<T> Unwrap<T>(this UniTask<Task<T>> task, bool continueOnCapturedContext)
{
return await (await task).ConfigureAwait(continueOnCapturedContext);
}
public static async UniTask Unwrap<T>(this UniTask<Task> task) public static async UniTask Unwrap(this UniTask<Task> task)
{ {
await await task; await await task;
} }
public static async UniTask Unwrap(this UniTask<Task> task, bool continueOnCapturedContext)
{
await (await task).ConfigureAwait(continueOnCapturedContext);
}
#if UNITY_2018_3_OR_NEWER #if UNITY_2018_3_OR_NEWER
sealed class ToCoroutineEnumerator : IEnumerator sealed class ToCoroutineEnumerator : IEnumerator

View File

@ -46,6 +46,11 @@ namespace Cysharp.Threading.Tasks
this.continuationAction = null; this.continuationAction = null;
} }
public AssetBundleRequestAllAssetsAwaiter GetAwaiter()
{
return this;
}
public bool IsCompleted => asyncOperation.isDone; public bool IsCompleted => asyncOperation.isDone;
public UnityEngine.Object[] GetResult() public UnityEngine.Object[] GetResult()