StartAsyncCoroutine returns UniTask
parent
3de29a181d
commit
f6622ad29c
|
@ -5,10 +5,10 @@ namespace Cysharp.Threading.Tasks
|
||||||
{
|
{
|
||||||
public static partial class UnityAsyncExtensions
|
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();
|
var token = monoBehaviour.GetCancellationTokenOnDestroy();
|
||||||
asyncCoroutine(token).Forget();
|
return asyncCoroutine(token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue