R3MotionExtensions
Expose tween values from a builder as an R3 Observable, bind values to a ReactiveProperty or register disposal.
public static class R3MotionExtensionsRequires org.nuget.r3 / com.cysharp.r3
Members
ToObservable
Bind the builder and expose its values as a stream. Both motion completion and cancellation finish the stream.
public static Observable<float> ToObservable(this FloatMotionBuilder builder)Parameters and return value
builderthis FloatMotionBuilderConfigured builder, passed as the receiver for extension calls.- Returns
Observable<float>
public static Observable<TValue> ToObservable<TValue, TOptions, TAdapter>(this MotionBuilder<TValue, TOptions, TAdapter> builder)
where TValue : unmanaged
where TOptions : unmanaged, IMotionOptions
where TAdapter : unmanaged, IMotionAdapter<TValue, TOptions>Parameters and return value
builderthis MotionBuilder<TValue, TOptions, TAdapter>Configured builder, passed as the receiver for extension calls.- Returns
Observable<TValue>
BindToReactiveProperty
Write each interpolated value into the supplied ReactiveProperty.
public static MotionHandle BindToReactiveProperty(this FloatMotionBuilder builder, ReactiveProperty<float> reactiveProperty)Parameters and return value
builderthis FloatMotionBuilderConfigured builder, passed as the receiver for extension calls.reactivePropertyReactiveProperty<float>Reactive property that receives each sampled value.- Returns
MotionHandle
public static MotionHandle BindToReactiveProperty<TValue, TOptions, TAdapter>(this MotionBuilder<TValue, TOptions, TAdapter> builder, ReactiveProperty<TValue> reactiveProperty)
where TValue : unmanaged
where TOptions : unmanaged, IMotionOptions
where TAdapter : unmanaged, IMotionAdapter<TValue, TOptions>Parameters and return value
builderthis MotionBuilder<TValue, TOptions, TAdapter>Configured builder, passed as the receiver for extension calls.reactivePropertyReactiveProperty<TValue>Reactive property that receives each sampled value.- Returns
MotionHandle
AddTo
Register the handle in an R3 disposable container and apply disposeBehavior on disposal.
public static MotionHandle AddTo(this MotionHandle handle, CompositeDisposable disposable, DisposeBehavior disposeBehavior = DisposeBehavior.Cancel)Parameters and return value
handlethis MotionHandleHandle to control or link.disposableCompositeDisposableR3 container that owns disposal of the handle.disposeBehavior = DisposeBehavior.CancelDisposeBehaviorAction to apply when the registered IDisposable is disposed.- Returns
MotionHandle
public static MotionHandle AddTo(this MotionHandle handle, SerialDisposable disposable, DisposeBehavior disposeBehavior = DisposeBehavior.Cancel)Parameters and return value
handlethis MotionHandleHandle to control or link.disposableSerialDisposableR3 container that owns disposal of the handle.disposeBehavior = DisposeBehavior.CancelDisposeBehaviorAction to apply when the registered IDisposable is disposed.- Returns
MotionHandle
public static MotionHandle AddTo(this MotionHandle handle, ref DisposableBag disposable, DisposeBehavior disposeBehavior = DisposeBehavior.Cancel)Parameters and return value
handlethis MotionHandleHandle to control or link.disposableref DisposableBagR3 container that owns disposal of the handle.disposeBehavior = DisposeBehavior.CancelDisposeBehaviorAction to apply when the registered IDisposable is disposed.- Returns
MotionHandle
public static MotionHandle AddTo(this MotionHandle handle, ref DisposableBuilder disposable, DisposeBehavior disposeBehavior = DisposeBehavior.Cancel)Parameters and return value
handlethis MotionHandleHandle to control or link.disposableref DisposableBuilderR3 container that owns disposal of the handle.disposeBehavior = DisposeBehavior.CancelDisposeBehaviorAction to apply when the registered IDisposable is disposed.- Returns
MotionHandle
MeatMotion