add Unwrap

pull/142/head
hikari 2020-08-26 15:59:40 +09:00 committed by GitHub
parent 53907a3719
commit 32f9b9d4ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 0 deletions

View File

@ -737,6 +737,26 @@ namespace Cysharp.Threading.Tasks
await await task; await await task;
} }
public static async UniTask<T> Unwrap<T>(this Task<UniTask<T>> task)
{
return await await task;
}
public static async UniTask Unwrap<T>(this Task<UniTask> task)
{
await await task;
}
public static async UniTask<T> Unwrap<T>(this UniTask<Task<T>> task)
{
return await await task;
}
public static async UniTask Unwrap<T>(this UniTask<Task> task)
{
await await task;
}
#if UNITY_2018_3_OR_NEWER #if UNITY_2018_3_OR_NEWER
sealed class ToCoroutineEnumerator : IEnumerator sealed class ToCoroutineEnumerator : IEnumerator