# UniTaskMotionExtensions

Wait through UniTask or update an AsyncReactiveProperty. Choose the action taken when the wait token is canceled.

Namespace: MeatMotion

Assembly: MeatMotion.Integrations.UniTask

```csharp
public static class UniTaskMotionExtensions
```

Requires com.cysharp.unitask

[Runtime/Integrations/UniTask/UniTaskMotionExtensions.cs · L7](../../../source/Runtime/Integrations/UniTask/UniTaskMotionExtensions.cs.html#L7)

## ToUniTask

Wait for the handle via UniTask and choose how token cancellation affects the underlying motion.

```csharp
public static UniTask ToUniTask(this MotionHandle handle, CancellationToken cancellationToken = default)
```

Parameters and return value

- `handle` (`this MotionHandle`) Handle to control or link.
- `cancellationToken = default` (`CancellationToken`) Token used to cancel the wait.
- Returns: `UniTask`

[Runtime/Integrations/UniTask/UniTaskMotionExtensions.cs · L9](../../../source/Runtime/Integrations/UniTask/UniTaskMotionExtensions.cs.html#L9)

```csharp
public static UniTask ToUniTask(this MotionHandle handle, CancelBehavior cancelBehavior, CancellationToken cancellationToken = default)
```

Parameters and return value

- `handle` (`this MotionHandle`) Handle to control or link.
- `cancelBehavior` (`CancelBehavior`) Action applied to the tween when the wait token is canceled.
- `cancellationToken = default` (`CancellationToken`) Token used to cancel the wait.
- Returns: `UniTask`

[Runtime/Integrations/UniTask/UniTaskMotionExtensions.cs · L12](../../../source/Runtime/Integrations/UniTask/UniTaskMotionExtensions.cs.html#L12)

```csharp
public static UniTask ToUniTask(this MotionHandle handle, CancelBehavior cancelBehavior, bool cancelAwaitOnMotionCanceled, CancellationToken cancellationToken = default)
```

Parameters and return value

- `handle` (`this MotionHandle`) Handle to control or link.
- `cancelBehavior` (`CancelBehavior`) Action applied to the tween when the wait token is canceled.
- `cancelAwaitOnMotionCanceled` (`bool`) Whether canceling the motion itself also cancels the wait.
- `cancellationToken = default` (`CancellationToken`) Token used to cancel the wait.
- Returns: `UniTask`

[Runtime/Integrations/UniTask/UniTaskMotionExtensions.cs · L15](../../../source/Runtime/Integrations/UniTask/UniTaskMotionExtensions.cs.html#L15)

## BindToAsyncReactiveProperty

Write interpolated values to an AsyncReactiveProperty.

```csharp
public static MotionHandle BindToAsyncReactiveProperty(this FloatMotionBuilder builder, AsyncReactiveProperty<float> reactiveProperty)
```

Parameters and return value

- `builder` (`this FloatMotionBuilder`) Configured builder, passed as the receiver for extension calls.
- `reactiveProperty` (`AsyncReactiveProperty<float>`) Reactive property that receives each sampled value.
- Returns: `MotionHandle`

[Runtime/Integrations/UniTask/UniTaskMotionExtensions.cs · L72](../../../source/Runtime/Integrations/UniTask/UniTaskMotionExtensions.cs.html#L72)

```csharp
public static MotionHandle BindToAsyncReactiveProperty<TValue, TOptions, TAdapter>(this MotionBuilder<TValue, TOptions, TAdapter> builder, AsyncReactiveProperty<TValue> reactiveProperty)
    where TValue : unmanaged
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<TValue, TOptions>
```

Parameters and return value

- `builder` (`this MotionBuilder<TValue, TOptions, TAdapter>`) Configured builder, passed as the receiver for extension calls.
- `reactiveProperty` (`AsyncReactiveProperty<TValue>`) Reactive property that receives each sampled value.
- Returns: `MotionHandle`

[Runtime/Integrations/UniTask/UniTaskMotionExtensions.cs · L75](../../../source/Runtime/Integrations/UniTask/UniTaskMotionExtensions.cs.html#L75)
