Merge pull request #142 from hikarin522/patch-2

Add UniTaskExtensions.Unwrap()
master
Yoshifumi Kawai 2020-08-28 04:51:16 +09:00 committed by GitHub
commit 0c0f79c6db
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;
}
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
sealed class ToCoroutineEnumerator : IEnumerator