# UniRxMotionExtensions

Observe a builder’s tween values through UniRx or write tween values into a ReactiveProperty.

Namespace: MeatMotion

Assembly: MeatMotion.Integrations.UniRx

```csharp
public static class UniRxMotionExtensions
```

Requires com.neuecc.unirx

[Runtime/Integrations/UniRx/UniRxMotionExtensions.cs · L6](../../../source/Runtime/Integrations/UniRx/UniRxMotionExtensions.cs.html#L6)

## ToObservable

Bind the builder and expose its values as a stream. Both motion completion and cancellation finish the stream.

```csharp
public static IObservable<float> ToObservable(this FloatMotionBuilder builder)
```

Parameters and return value

- `builder` (`this FloatMotionBuilder`) Configured builder, passed as the receiver for extension calls.
- Returns: `IObservable<float>`

[Runtime/Integrations/UniRx/UniRxMotionExtensions.cs · L8](../../../source/Runtime/Integrations/UniRx/UniRxMotionExtensions.cs.html#L8)

```csharp
public static IObservable<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

- `builder` (`this MotionBuilder<TValue, TOptions, TAdapter>`) Configured builder, passed as the receiver for extension calls.
- Returns: `IObservable<TValue>`

[Runtime/Integrations/UniRx/UniRxMotionExtensions.cs · L11](../../../source/Runtime/Integrations/UniRx/UniRxMotionExtensions.cs.html#L11)

## BindToReactiveProperty

Write each interpolated value into the supplied ReactiveProperty.

```csharp
public static MotionHandle BindToReactiveProperty(this FloatMotionBuilder builder, ReactiveProperty<float> reactiveProperty)
```

Parameters and return value

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

[Runtime/Integrations/UniRx/UniRxMotionExtensions.cs · L20](../../../source/Runtime/Integrations/UniRx/UniRxMotionExtensions.cs.html#L20)

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

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

[Runtime/Integrations/UniRx/UniRxMotionExtensions.cs · L23](../../../source/Runtime/Integrations/UniRx/UniRxMotionExtensions.cs.html#L23)
