# MotionSettings<TValue, TOptions>

開始値・終了値、時間、イーズ、ループ、書き込み設定をレコードとして保存し、複数のTween作成に使えます。

Namespace: MeatMotion

Assembly: MeatMotion

```csharp
public record MotionSettings<TValue, TOptions>
    where TValue : unmanaged
    where TOptions : unmanaged, IMotionOptions
```

[Runtime/MotionSettings.cs · L12](../../source/Runtime/MotionSettings.cs.html#L12)

## 始点と終点を保存して再生する

`using MeatMotion;` を追加します。この設定から作成したTweenを0.5秒進めると、2と6の間の値4を書き込みます。

```csharp
using var world = new MotionWorld();
var settings = new MotionSettings<float, NoOptions>
{
    StartValue = 2f, EndValue = 6f, Duration = 1f, Scheduler = world
};
float value = 0f;
MMotion.Create(settings).Bind(v => value = v);
world.Tick(0.5);
```

## StartValue

補間に使う開始値を保持します。

```csharp
public TValue StartValue { get; init; }
```

[Runtime/MotionSettings.cs · L31](../../source/Runtime/MotionSettings.cs.html#L31)

## EndValue

補間に使う終了値を保持します。

```csharp
public TValue EndValue { get; init; }
```

[Runtime/MotionSettings.cs · L32](../../source/Runtime/MotionSettings.cs.html#L32)

## Duration

各補間区間の秒数です。長さの単位は秒です。

```csharp
public float Duration { get; init; }
```

[Runtime/MotionSettings.cs · L33](../../source/Runtime/MotionSettings.cs.html#L33)

## Options

Evaluateに渡すアダプター固有のオプションです。

```csharp
public TOptions Options { get; init; }
```

[Runtime/MotionSettings.cs · L34](../../source/Runtime/MotionSettings.cs.html#L34)

## Ease

正規化した時刻に適用するイーズを指定します。

```csharp
public Ease Ease { get; init; }
```

[Runtime/MotionSettings.cs · L35](../../source/Runtime/MotionSettings.cs.html#L35)

## CustomEaseCurve

CustomAnimationCurveを選択した場合に使用するUnityのカーブです。

```csharp
public AnimationCurve CustomEaseCurve { get; init; }
```

[Runtime/MotionSettings.cs · L36](../../source/Runtime/MotionSettings.cs.html#L36)

## Delay

開始前または各ループ前に待機する秒数です。

```csharp
public float Delay { get; init; }
```

[Runtime/MotionSettings.cs · L37](../../source/Runtime/MotionSettings.cs.html#L37)

## DelayType

Delayを初回だけに適用するか、すべてのループに適用するかを決めます。

```csharp
public DelayType DelayType { get; init; }
```

[Runtime/MotionSettings.cs · L38](../../source/Runtime/MotionSettings.cs.html#L38)

## Loops

設定したループ回数です。

```csharp
public int Loops { get; init; }
```

[Runtime/MotionSettings.cs · L39](../../source/Runtime/MotionSettings.cs.html#L39)

## LoopType

各ループの評価方法をRestart、Flip、Incremental、Yoyoから選びます。

```csharp
public LoopType LoopType { get; init; }
```

[Runtime/MotionSettings.cs · L40](../../source/Runtime/MotionSettings.cs.html#L40)

## CancelOnError

setterが例外を投げた場合にTweenをキャンセルする設定です。

```csharp
public bool CancelOnError { get; init; }
```

[Runtime/MotionSettings.cs · L41](../../source/Runtime/MotionSettings.cs.html#L41)

## SkipValuesDuringDelay

遅延中の更新でバインド先への書き込みを抑止するかを指定します。

```csharp
public bool SkipValuesDuringDelay { get; init; }
```

[Runtime/MotionSettings.cs · L42](../../source/Runtime/MotionSettings.cs.html#L42)

## ImmediateBind

Bindした瞬間に初回の値を書き込むかを指定します。

```csharp
public bool ImmediateBind { get; init; }
```

[Runtime/MotionSettings.cs · L43](../../source/Runtime/MotionSettings.cs.html#L43)

## Scheduler

この設定からTweenを作るときの登録先です。

```csharp
public IMotionScheduler Scheduler { get; init; }
```

[Runtime/MotionSettings.cs · L44](../../source/Runtime/MotionSettings.cs.html#L44)
