Show / Hide Table of Contents

# UnityAsyncExtensions Class

###### Namespace: Cysharp.Threading.Tasks

###### Assembly: cs.temp.dll.dll

    public static class UnityAsyncExtensions

##### Inheritance

System.Object → UnityAsyncExtensions

### Members

#### Methods

Name | Description
--- | ---
GetAsyncClickEventHandler(Button) |
GetAsyncClickEventHandler(Button, CancellationToken) |
GetAsyncEndEditEventHandler(InputField) |
GetAsyncEndEditEventHandler(InputField, CancellationToken) |
GetAsyncEventHandler(UnityEvent, CancellationToken) |
GetAsyncEventHandler<T>(UnityEvent<T>, CancellationToken) |
GetAsyncValueChangedEventHandler(Dropdown) |
GetAsyncValueChangedEventHandler(Dropdown, CancellationToken) |
GetAsyncValueChangedEventHandler(InputField) |
GetAsyncValueChangedEventHandler(InputField, CancellationToken) |
GetAsyncValueChangedEventHandler(Scrollbar) |
GetAsyncValueChangedEventHandler(Scrollbar, CancellationToken) |
GetAsyncValueChangedEventHandler(ScrollRect) |
GetAsyncValueChangedEventHandler(ScrollRect, CancellationToken) |
GetAsyncValueChangedEventHandler(Slider) |
GetAsyncValueChangedEventHandler(Slider, CancellationToken) |
GetAsyncValueChangedEventHandler(Toggle) |
GetAsyncValueChangedEventHandler(Toggle, CancellationToken) |
GetAwaiter(AsyncGPUReadbackRequest) |
GetAwaiter(AsyncOperation) |
GetAwaiter(ResourceRequest) |
OnClickAsAsyncEnumerable(Button) |
OnClickAsAsyncEnumerable(Button, CancellationToken) |
OnClickAsync(Button) |
OnClickAsync(Button, CancellationToken) |
OnEndEditAsAsyncEnumerable(InputField) |
OnEndEditAsAsyncEnumerable(InputField, CancellationToken) |
OnEndEditAsync(InputField) |
OnEndEditAsync(InputField, CancellationToken) |
OnInvokeAsAsyncEnumerable(UnityEvent, CancellationToken) |
OnInvokeAsAsyncEnumerable<T>(UnityEvent<T>, CancellationToken) |
OnInvokeAsync(UnityEvent, CancellationToken) |
OnInvokeAsync<T>(UnityEvent<T>, CancellationToken) |
OnValueChangedAsAsyncEnumerable(Dropdown) |
OnValueChangedAsAsyncEnumerable(Dropdown, CancellationToken) |
OnValueChangedAsAsyncEnumerable(InputField) |
OnValueChangedAsAsyncEnumerable(InputField, CancellationToken) |
OnValueChangedAsAsyncEnumerable(Scrollbar) |
OnValueChangedAsAsyncEnumerable(Scrollbar, CancellationToken) |
OnValueChangedAsAsyncEnumerable(ScrollRect) |
OnValueChangedAsAsyncEnumerable(ScrollRect, CancellationToken) |
OnValueChangedAsAsyncEnumerable(Slider) |
OnValueChangedAsAsyncEnumerable(Slider, CancellationToken) |
OnValueChangedAsAsyncEnumerable(Toggle) |
OnValueChangedAsAsyncEnumerable(Toggle, CancellationToken) |
OnValueChangedAsync(Dropdown) |
OnValueChangedAsync(Dropdown, CancellationToken) |
OnValueChangedAsync(InputField) |
OnValueChangedAsync(InputField, CancellationToken) |
OnValueChangedAsync(Scrollbar) |
OnValueChangedAsync(Scrollbar, CancellationToken) |
OnValueChangedAsync(ScrollRect) |
OnValueChangedAsync(ScrollRect, CancellationToken) |
OnValueChangedAsync(Slider) |
OnValueChangedAsync(Slider, CancellationToken) |
OnValueChangedAsync(Toggle) |
OnValueChangedAsync(Toggle, CancellationToken) |
StartAsyncCoroutine(UnityEngine.MonoBehaviour, Func<CancellationToken, UniTask>) |
ToUniTask(AsyncGPUReadbackRequest, PlayerLoopTiming, CancellationToken) |
ToUniTask(AsyncOperation, IProgress<Single>, PlayerLoopTiming, CancellationToken) |
ToUniTask(ResourceRequest, IProgress<Single>, PlayerLoopTiming, CancellationToken) |
WithCancellation(AsyncGPUReadbackRequest, CancellationToken) |
WithCancellation(AsyncOperation, CancellationToken) |
WithCancellation(ResourceRequest, CancellationToken) |

### Methods

#### GetAsyncClickEventHandler(Button)

    public static IAsyncClickEventHandler GetAsyncClickEventHandler(this Button button)

##### Parameters

`button` Button

##### Returns

IAsyncClickEventHandler

#### GetAsyncClickEventHandler(Button, CancellationToken)

    public static IAsyncClickEventHandler GetAsyncClickEventHandler(this Button button, CancellationToken cancellationToken)

##### Parameters

`button` Button
`cancellationToken` CancellationToken

##### Returns

IAsyncClickEventHandler

#### GetAsyncEndEditEventHandler(InputField)

    public static IAsyncEndEditEventHandler<string> GetAsyncEndEditEventHandler(this InputField inputField)

##### Parameters

`inputField` InputField

##### Returns

IAsyncEndEditEventHandler<System.String>

#### GetAsyncEndEditEventHandler(InputField, CancellationToken)

    public static IAsyncEndEditEventHandler<string> GetAsyncEndEditEventHandler(this InputField inputField, CancellationToken cancellationToken)

##### Parameters

`inputField` InputField
`cancellationToken` CancellationToken

##### Returns

IAsyncEndEditEventHandler<System.String>

#### GetAsyncEventHandler(UnityEvent, CancellationToken)

    public static AsyncUnityEventHandler GetAsyncEventHandler(this UnityEvent unityEvent, CancellationToken cancellationToken)

##### Parameters

`unityEvent` UnityEvent
`cancellationToken` CancellationToken

##### Returns

AsyncUnityEventHandler

#### GetAsyncEventHandler<T>(UnityEvent<T>, CancellationToken)

    public static AsyncUnityEventHandler<T> GetAsyncEventHandler<T>(this UnityEvent<T> unityEvent, CancellationToken cancellationToken)

##### Parameters

`unityEvent` UnityEvent<T>
`cancellationToken` CancellationToken

##### Returns

AsyncUnityEventHandler<T>

##### Type Parameters

`T`

#### GetAsyncValueChangedEventHandler(Dropdown)

    public static IAsyncValueChangedEventHandler<int> GetAsyncValueChangedEventHandler(this Dropdown dropdown)

##### Parameters

`dropdown` Dropdown

##### Returns

IAsyncValueChangedEventHandler<System.Int32>

#### GetAsyncValueChangedEventHandler(Dropdown, CancellationToken)

    public static IAsyncValueChangedEventHandler<int> GetAsyncValueChangedEventHandler(this Dropdown dropdown, CancellationToken cancellationToken)

##### Parameters

`dropdown` Dropdown
`cancellationToken` CancellationToken

##### Returns

IAsyncValueChangedEventHandler<System.Int32>

#### GetAsyncValueChangedEventHandler(InputField)

    public static IAsyncValueChangedEventHandler<string> GetAsyncValueChangedEventHandler(this InputField inputField)

##### Parameters

`inputField` InputField

##### Returns

IAsyncValueChangedEventHandler<System.String>

#### GetAsyncValueChangedEventHandler(InputField, CancellationToken)

    public static IAsyncValueChangedEventHandler<string> GetAsyncValueChangedEventHandler(this InputField inputField, CancellationToken cancellationToken)

##### Parameters

`inputField` InputField
`cancellationToken` CancellationToken

##### Returns

IAsyncValueChangedEventHandler<System.String>

#### GetAsyncValueChangedEventHandler(Scrollbar)

    public static IAsyncValueChangedEventHandler<float> GetAsyncValueChangedEventHandler(this Scrollbar scrollbar)

##### Parameters

`scrollbar` Scrollbar

##### Returns

IAsyncValueChangedEventHandler<System.Single>

#### GetAsyncValueChangedEventHandler(Scrollbar, CancellationToken)

    public static IAsyncValueChangedEventHandler<float> GetAsyncValueChangedEventHandler(this Scrollbar scrollbar, CancellationToken cancellationToken)

##### Parameters

`scrollbar` Scrollbar
`cancellationToken` CancellationToken

##### Returns

IAsyncValueChangedEventHandler<System.Single>

#### GetAsyncValueChangedEventHandler(ScrollRect)

    public static IAsyncValueChangedEventHandler<Vector2> GetAsyncValueChangedEventHandler(this ScrollRect scrollRect)

##### Parameters

`scrollRect` ScrollRect

##### Returns

IAsyncValueChangedEventHandler<Vector2>

#### GetAsyncValueChangedEventHandler(ScrollRect, CancellationToken)

    public static IAsyncValueChangedEventHandler<Vector2> GetAsyncValueChangedEventHandler(this ScrollRect scrollRect, CancellationToken cancellationToken)

##### Parameters

`scrollRect` ScrollRect
`cancellationToken` CancellationToken

##### Returns

IAsyncValueChangedEventHandler<Vector2>

#### GetAsyncValueChangedEventHandler(Slider)

    public static IAsyncValueChangedEventHandler<float> GetAsyncValueChangedEventHandler(this Slider slider)

##### Parameters

`slider` Slider

##### Returns

IAsyncValueChangedEventHandler<System.Single>

#### GetAsyncValueChangedEventHandler(Slider, CancellationToken)

    public static IAsyncValueChangedEventHandler<float> GetAsyncValueChangedEventHandler(this Slider slider, CancellationToken cancellationToken)

##### Parameters

`slider` Slider
`cancellationToken` CancellationToken

##### Returns

IAsyncValueChangedEventHandler<System.Single>

#### GetAsyncValueChangedEventHandler(Toggle)

    public static IAsyncValueChangedEventHandler<bool> GetAsyncValueChangedEventHandler(this Toggle toggle)

##### Parameters

`toggle` Toggle

##### Returns

IAsyncValueChangedEventHandler<System.Boolean>

#### GetAsyncValueChangedEventHandler(Toggle, CancellationToken)

    public static IAsyncValueChangedEventHandler<bool> GetAsyncValueChangedEventHandler(this Toggle toggle, CancellationToken cancellationToken)

##### Parameters

`toggle` Toggle
`cancellationToken` CancellationToken

##### Returns

IAsyncValueChangedEventHandler<System.Boolean>

#### GetAwaiter(AsyncGPUReadbackRequest)

    public static UniTask<AsyncGPUReadbackRequest>.Awaiter GetAwaiter(this AsyncGPUReadbackRequest asyncOperation)

##### Parameters

`asyncOperation` AsyncGPUReadbackRequest

##### Returns

UniTask.Awaiter<>

#### GetAwaiter(AsyncOperation)

    public static UnityAsyncExtensions.AsyncOperationAwaiter GetAwaiter(this AsyncOperation asyncOperation)

##### Parameters

`asyncOperation` AsyncOperation

##### Returns

UnityAsyncExtensions.AsyncOperationAwaiter

#### GetAwaiter(ResourceRequest)

    public static UnityAsyncExtensions.ResourceRequestAwaiter GetAwaiter(this ResourceRequest asyncOperation)

##### Parameters

`asyncOperation` ResourceRequest

##### Returns

UnityAsyncExtensions.ResourceRequestAwaiter

#### OnClickAsAsyncEnumerable(Button)

    public static IUniTaskAsyncEnumerable<AsyncUnit> OnClickAsAsyncEnumerable(this Button button)

##### Parameters

`button` Button

##### Returns

IUniTaskAsyncEnumerable<AsyncUnit>

#### OnClickAsAsyncEnumerable(Button, CancellationToken)

    public static IUniTaskAsyncEnumerable<AsyncUnit> OnClickAsAsyncEnumerable(this Button button, CancellationToken cancellationToken)

##### Parameters

`button` Button
`cancellationToken` CancellationToken

##### Returns

IUniTaskAsyncEnumerable<AsyncUnit>

#### OnClickAsync(Button)

    public static UniTask OnClickAsync(this Button button)

##### Parameters

`button` Button

##### Returns

UniTask

#### OnClickAsync(Button, CancellationToken)

    public static UniTask OnClickAsync(this Button button, CancellationToken cancellationToken)

##### Parameters

`button` Button
`cancellationToken` CancellationToken

##### Returns

UniTask

#### OnEndEditAsAsyncEnumerable(InputField)

    public static IUniTaskAsyncEnumerable<string> OnEndEditAsAsyncEnumerable(this InputField inputField)

##### Parameters

`inputField` InputField

##### Returns

IUniTaskAsyncEnumerable<System.String>

#### OnEndEditAsAsyncEnumerable(InputField, CancellationToken)

    public static IUniTaskAsyncEnumerable<string> OnEndEditAsAsyncEnumerable(this InputField inputField, CancellationToken cancellationToken)

##### Parameters

`inputField` InputField
`cancellationToken` CancellationToken

##### Returns

IUniTaskAsyncEnumerable<System.String>

#### OnEndEditAsync(InputField)

    public static UniTask<string> OnEndEditAsync(this InputField inputField)

##### Parameters

`inputField` InputField

##### Returns

UniTask<System.String>

#### OnEndEditAsync(InputField, CancellationToken)

    public static UniTask<string> OnEndEditAsync(this InputField inputField, CancellationToken cancellationToken)

##### Parameters

`inputField` InputField
`cancellationToken` CancellationToken

##### Returns

UniTask<System.String>

#### OnInvokeAsAsyncEnumerable(UnityEvent, CancellationToken)

    public static IUniTaskAsyncEnumerable<AsyncUnit> OnInvokeAsAsyncEnumerable(this UnityEvent unityEvent, CancellationToken cancellationToken)

##### Parameters

`unityEvent` UnityEvent
`cancellationToken` CancellationToken

##### Returns

IUniTaskAsyncEnumerable<AsyncUnit>

#### OnInvokeAsAsyncEnumerable<T>(UnityEvent<T>, CancellationToken)

    public static IUniTaskAsyncEnumerable<T> OnInvokeAsAsyncEnumerable<T>(this UnityEvent<T> unityEvent, CancellationToken cancellationToken)

##### Parameters

`unityEvent` UnityEvent<T>
`cancellationToken` CancellationToken

##### Returns

IUniTaskAsyncEnumerable<T>

##### Type Parameters

`T`

#### OnInvokeAsync(UnityEvent, CancellationToken)

    public static UniTask OnInvokeAsync(this UnityEvent unityEvent, CancellationToken cancellationToken)

##### Parameters

`unityEvent` UnityEvent
`cancellationToken` CancellationToken

##### Returns

UniTask

#### OnInvokeAsync<T>(UnityEvent<T>, CancellationToken)

    public static UniTask<T> OnInvokeAsync<T>(this UnityEvent<T> unityEvent, CancellationToken cancellationToken)

##### Parameters

`unityEvent` UnityEvent<T>
`cancellationToken` CancellationToken

##### Returns

UniTask<T>

##### Type Parameters

`T`

#### OnValueChangedAsAsyncEnumerable(Dropdown)

    public static IUniTaskAsyncEnumerable<int> OnValueChangedAsAsyncEnumerable(this Dropdown dropdown)

##### Parameters

`dropdown` Dropdown

##### Returns

IUniTaskAsyncEnumerable<System.Int32>

#### OnValueChangedAsAsyncEnumerable(Dropdown, CancellationToken)

    public static IUniTaskAsyncEnumerable<int> OnValueChangedAsAsyncEnumerable(this Dropdown dropdown, CancellationToken cancellationToken)

##### Parameters

`dropdown` Dropdown
`cancellationToken` CancellationToken

##### Returns

IUniTaskAsyncEnumerable<System.Int32>

#### OnValueChangedAsAsyncEnumerable(InputField)

    public static IUniTaskAsyncEnumerable<string> OnValueChangedAsAsyncEnumerable(this InputField inputField)

##### Parameters

`inputField` InputField

##### Returns

IUniTaskAsyncEnumerable<System.String>

#### OnValueChangedAsAsyncEnumerable(InputField, CancellationToken)

    public static IUniTaskAsyncEnumerable<string> OnValueChangedAsAsyncEnumerable(this InputField inputField, CancellationToken cancellationToken)

##### Parameters

`inputField` InputField
`cancellationToken` CancellationToken

##### Returns

IUniTaskAsyncEnumerable<System.String>

#### OnValueChangedAsAsyncEnumerable(Scrollbar)

    public static IUniTaskAsyncEnumerable<float> OnValueChangedAsAsyncEnumerable(this Scrollbar scrollbar)

##### Parameters

`scrollbar` Scrollbar

##### Returns

IUniTaskAsyncEnumerable<System.Single>

#### OnValueChangedAsAsyncEnumerable(Scrollbar, CancellationToken)

    public static IUniTaskAsyncEnumerable<float> OnValueChangedAsAsyncEnumerable(this Scrollbar scrollbar, CancellationToken cancellationToken)

##### Parameters

`scrollbar` Scrollbar
`cancellationToken` CancellationToken

##### Returns

IUniTaskAsyncEnumerable<System.Single>

#### OnValueChangedAsAsyncEnumerable(ScrollRect)

    public static IUniTaskAsyncEnumerable<Vector2> OnValueChangedAsAsyncEnumerable(this ScrollRect scrollRect)

##### Parameters

`scrollRect` ScrollRect

##### Returns

IUniTaskAsyncEnumerable<Vector2>

#### OnValueChangedAsAsyncEnumerable(ScrollRect, CancellationToken)

    public static IUniTaskAsyncEnumerable<Vector2> OnValueChangedAsAsyncEnumerable(this ScrollRect scrollRect, CancellationToken cancellationToken)

##### Parameters

`scrollRect` ScrollRect
`cancellationToken` CancellationToken

##### Returns

IUniTaskAsyncEnumerable<Vector2>

#### OnValueChangedAsAsyncEnumerable(Slider)

    public static IUniTaskAsyncEnumerable<float> OnValueChangedAsAsyncEnumerable(this Slider slider)

##### Parameters

`slider` Slider

##### Returns

IUniTaskAsyncEnumerable<System.Single>

#### OnValueChangedAsAsyncEnumerable(Slider, CancellationToken)

    public static IUniTaskAsyncEnumerable<float> OnValueChangedAsAsyncEnumerable(this Slider slider, CancellationToken cancellationToken)

##### Parameters

`slider` Slider
`cancellationToken` CancellationToken

##### Returns

IUniTaskAsyncEnumerable<System.Single>

#### OnValueChangedAsAsyncEnumerable(Toggle)

    public static IUniTaskAsyncEnumerable<bool> OnValueChangedAsAsyncEnumerable(this Toggle toggle)

##### Parameters

`toggle` Toggle

##### Returns

IUniTaskAsyncEnumerable<System.Boolean>

#### OnValueChangedAsAsyncEnumerable(Toggle, CancellationToken)

    public static IUniTaskAsyncEnumerable<bool> OnValueChangedAsAsyncEnumerable(this Toggle toggle, CancellationToken cancellationToken)

##### Parameters

`toggle` Toggle
`cancellationToken` CancellationToken

##### Returns

IUniTaskAsyncEnumerable<System.Boolean>

#### OnValueChangedAsync(Dropdown)

    public static UniTask<int> OnValueChangedAsync(this Dropdown dropdown)

##### Parameters

`dropdown` Dropdown

##### Returns

UniTask<System.Int32>

#### OnValueChangedAsync(Dropdown, CancellationToken)

    public static UniTask<int> OnValueChangedAsync(this Dropdown dropdown, CancellationToken cancellationToken)

##### Parameters

`dropdown` Dropdown
`cancellationToken` CancellationToken

##### Returns

UniTask<System.Int32>

#### OnValueChangedAsync(InputField)

    public static UniTask<string> OnValueChangedAsync(this InputField inputField)

##### Parameters

`inputField` InputField

##### Returns

UniTask<System.String>

#### OnValueChangedAsync(InputField, CancellationToken)

    public static UniTask<string> OnValueChangedAsync(this InputField inputField, CancellationToken cancellationToken)

##### Parameters

`inputField` InputField
`cancellationToken` CancellationToken

##### Returns

UniTask<System.String>

#### OnValueChangedAsync(Scrollbar)

    public static UniTask<float> OnValueChangedAsync(this Scrollbar scrollbar)

##### Parameters

`scrollbar` Scrollbar

##### Returns

UniTask<System.Single>

#### OnValueChangedAsync(Scrollbar, CancellationToken)

    public static UniTask<float> OnValueChangedAsync(this Scrollbar scrollbar, CancellationToken cancellationToken)

##### Parameters

`scrollbar` Scrollbar
`cancellationToken` CancellationToken

##### Returns

UniTask<System.Single>

#### OnValueChangedAsync(ScrollRect)

    public static UniTask<Vector2> OnValueChangedAsync(this ScrollRect scrollRect)

##### Parameters

`scrollRect` ScrollRect

##### Returns

UniTask<Vector2>

#### OnValueChangedAsync(ScrollRect, CancellationToken)

    public static UniTask<Vector2> OnValueChangedAsync(this ScrollRect scrollRect, CancellationToken cancellationToken)

##### Parameters

`scrollRect` ScrollRect
`cancellationToken` CancellationToken

##### Returns

UniTask<Vector2>

#### OnValueChangedAsync(Slider)

    public static UniTask<float> OnValueChangedAsync(this Slider slider)

##### Parameters

`slider` Slider

##### Returns

UniTask<System.Single>

#### OnValueChangedAsync(Slider, CancellationToken)

    public static UniTask<float> OnValueChangedAsync(this Slider slider, CancellationToken cancellationToken)

##### Parameters

`slider` Slider
`cancellationToken` CancellationToken

##### Returns

UniTask<System.Single>

#### OnValueChangedAsync(Toggle)

    public static UniTask<bool> OnValueChangedAsync(this Toggle toggle)

##### Parameters

`toggle` Toggle

##### Returns

UniTask<System.Boolean>

#### OnValueChangedAsync(Toggle, CancellationToken)

    public static UniTask<bool> OnValueChangedAsync(this Toggle toggle, CancellationToken cancellationToken)

##### Parameters

`toggle` Toggle
`cancellationToken` CancellationToken

##### Returns

UniTask<System.Boolean>

#### StartAsyncCoroutine(UnityEngine.MonoBehaviour, Func<CancellationToken, UniTask>)

    public static UniTask StartAsyncCoroutine(this UnityEngine.MonoBehaviour monoBehaviour, Func<CancellationToken, UniTask> asyncCoroutine)

##### Parameters

`monoBehaviour` UnityEngine.MonoBehaviour
`asyncCoroutine` System.Func<CancellationToken, UniTask>

##### Returns

UniTask

#### ToUniTask(AsyncGPUReadbackRequest, PlayerLoopTiming, CancellationToken)

    public static UniTask<AsyncGPUReadbackRequest> ToUniTask(this AsyncGPUReadbackRequest asyncOperation, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = null)

##### Parameters

`asyncOperation` AsyncGPUReadbackRequest
`timing` PlayerLoopTiming
`cancellationToken` CancellationToken

##### Returns

UniTask<AsyncGPUReadbackRequest>

#### ToUniTask(AsyncOperation, IProgress<Single>, PlayerLoopTiming, CancellationToken)

    public static UniTask ToUniTask(this AsyncOperation asyncOperation, IProgress<float> progress = null, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = null)

##### Parameters

`asyncOperation` AsyncOperation
`progress` System.IProgress<System.Single>
`timing` PlayerLoopTiming
`cancellationToken` CancellationToken

##### Returns

UniTask

#### ToUniTask(ResourceRequest, IProgress<Single>, PlayerLoopTiming, CancellationToken)

    public static UniTask<UnityEngine.Object> ToUniTask(this ResourceRequest asyncOperation, IProgress<float> progress = null, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = null)

##### Parameters

`asyncOperation` ResourceRequest
`progress` System.IProgress<System.Single>
`timing` PlayerLoopTiming
`cancellationToken` CancellationToken

##### Returns

UniTask<UnityEngine.Object>

#### WithCancellation(AsyncGPUReadbackRequest, CancellationToken)

    public static UniTask<AsyncGPUReadbackRequest> WithCancellation(this AsyncGPUReadbackRequest asyncOperation, CancellationToken cancellationToken)

##### Parameters

`asyncOperation` AsyncGPUReadbackRequest
`cancellationToken` CancellationToken

##### Returns

UniTask<AsyncGPUReadbackRequest>

#### WithCancellation(AsyncOperation, CancellationToken)

    public static UniTask WithCancellation(this AsyncOperation asyncOperation, CancellationToken cancellationToken)

##### Parameters

`asyncOperation` AsyncOperation
`cancellationToken` CancellationToken

##### Returns

UniTask

#### WithCancellation(ResourceRequest, CancellationToken)

    public static UniTask<UnityEngine.Object> WithCancellation(this ResourceRequest asyncOperation, CancellationToken cancellationToken)

##### Parameters

`asyncOperation` ResourceRequest
`cancellationToken` CancellationToken

##### Returns

UniTask<UnityEngine.Object>