MeatMotion

MotionSettings<TValue, TOptions>

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

Namespace
MeatMotion
Assembly
MeatMotion

メンバー一覧へ

public record MotionSettings<TValue, TOptions>
    where TValue : unmanaged
    where TOptions : unmanaged, IMotionOptions
MotionSettings.cs · L12

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

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

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

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

public TValue StartValue { get; init; }

EndValue

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

public TValue EndValue { get; init; }

Duration

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

public float Duration { get; init; }

Options

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

public TOptions Options { get; init; }

Ease

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

public Ease Ease { get; init; }

CustomEaseCurve

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

public AnimationCurve CustomEaseCurve { get; init; }

Delay

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

public float Delay { get; init; }

DelayType

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

public DelayType DelayType { get; init; }

Loops

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

public int Loops { get; init; }

LoopType

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

public LoopType LoopType { get; init; }

CancelOnError

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

public bool CancelOnError { get; init; }

SkipValuesDuringDelay

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

public bool SkipValuesDuringDelay { get; init; }

ImmediateBind

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

public bool ImmediateBind { get; init; }

Scheduler

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

public IMotionScheduler Scheduler { get; init; }