MeatMotion

UniTaskMotionExtensions

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

Namespace
MeatMotion
Assembly
MeatMotion.Integrations.UniTask

Jump to members

public static class UniTaskMotionExtensions

Requires com.cysharp.unitask

UniTaskMotionExtensions.cs · L7

Members

ToUniTask

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

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
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
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

BindToAsyncReactiveProperty

Write interpolated values to an AsyncReactiveProperty.

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
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