StartAsyncCoroutine returns UniTask

master
neuecc 2020-05-12 15:55:06 +09:00
parent 3de29a181d
commit f6622ad29c
1 changed files with 2 additions and 2 deletions

View File

@ -5,10 +5,10 @@ namespace Cysharp.Threading.Tasks
{
public static partial class UnityAsyncExtensions
{
public static void StartAsyncCoroutine(this UnityEngine.MonoBehaviour monoBehaviour, Func<CancellationToken, UniTask> asyncCoroutine)
public static UniTask StartAsyncCoroutine(this UnityEngine.MonoBehaviour monoBehaviour, Func<CancellationToken, UniTask> asyncCoroutine)
{
var token = monoBehaviour.GetCancellationTokenOnDestroy();
asyncCoroutine(token).Forget();
return asyncCoroutine(token);
}
}
}