MeatMotion

MotionSettings<TValue, TOptions>

Store endpoints, timing, easing, loops and binding options in a record for reuse across multiple tweens.

Namespace
MeatMotion
Assembly
MeatMotion

Jump to members

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

Create a tween from a settings record

Add using MeatMotion;. Ticking the tween for half a second writes 4, halfway between 2 and 6.

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

Members

StartValue

Starting value in the saved configuration.

public TValue StartValue { get; init; }

EndValue

End value in the saved configuration.

public TValue EndValue { get; init; }

Duration

Duration of an interpolation interval, in seconds.

public float Duration { get; init; }

Options

Adapter-specific options supplied to Evaluate.

public TOptions Options { get; init; }

Ease

Ease applied to normalized time.

public Ease Ease { get; init; }

CustomEaseCurve

Unity curve used when CustomAnimationCurve is selected.

public AnimationCurve CustomEaseCurve { get; init; }

Delay

Delay in seconds before the first pass or each loop.

public float Delay { get; init; }

DelayType

Apply Delay before the first pass or before every loop.

public DelayType DelayType { get; init; }

Loops

Configured number of loops.

public int Loops { get; init; }

LoopType

Select Restart, Flip, Incremental or Yoyo for repeated passes.

public LoopType LoopType { get; init; }

CancelOnError

Whether a setter exception cancels the motion.

public bool CancelOnError { get; init; }

SkipValuesDuringDelay

Whether to suppress writes to the binding during a delay.

public bool SkipValuesDuringDelay { get; init; }

ImmediateBind

Whether binding writes the initial sampled value immediately.

public bool ImmediateBind { get; init; }

Scheduler

Scheduler used when creating a tween from these settings.

public IMotionScheduler Scheduler { get; init; }