Skip to content

Commit

Permalink
Merge pull request #518 from Cysharp/hadashiA/awaitable-to-unitask
Browse files Browse the repository at this point in the history
Add Awaitable.AsUniTask()
  • Loading branch information
hadashiA authored Nov 2, 2023
2 parents 0970ae8 + 5f3aa18 commit 1288cbc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#if UNITY_2023_1_OR_NEWER
namespace Cysharp.Threading.Tasks
{
public static class UnityAwaitableExtensions
{
public static async UniTask AsUniTask(this UnityEngine.Awaitable awaitable)
{
await awaitable;
}

public static async UniTask<T> AsUniTask<T>(this UnityEngine.Awaitable<T> awaitable)
{
return await awaitable;
}
}
}
#endif

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1288cbc

Please sign in to comment.