Skip to content

Commit

Permalink
Add wrapper for UniTask.WaitUntilCanceled
Browse files Browse the repository at this point in the history
  • Loading branch information
desplesda committed Sep 6, 2024
1 parent dd2edbb commit 0983700
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Runtime/AsyncHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ public static partial class YarnAsync
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public async static YarnTask WaitUntilCanceled(System.Threading.CancellationToken token)
{
#if USE_UNITASK
await YarnTask.WaitUntilCanceled(token);
#else
while (token.IsCancellationRequested == false)
{
await YarnTask.Yield();
}
#endif
}

#if !USE_UNITASK
Expand Down

0 comments on commit 0983700

Please sign in to comment.