MeatMotion

FloatMotionBuilder

Configure a float tween created by MMotion.Create. A stateful Bind passes the target to the setter without a captured lambda.

Namespace
MeatMotion
Assembly
MeatMotion

Jump to members

public struct FloatMotionBuilder
FloatMotionBuilder.cs · L11

Members

WithScheduler

Choose the automatic update phase or manual world before binding.

public FloatMotionBuilder WithScheduler(MotionWorld world)
Parameters and return value
world
MotionWorld MotionWorld in which to schedule the tween.
Returns
FloatMotionBuilder
public FloatMotionBuilder WithScheduler(IMotionScheduler scheduler)
Parameters and return value
scheduler
IMotionScheduler Scheduler that determines where the motion is registered and updated.
Returns
FloatMotionBuilder

ToMotionSettings

Capture the configuration before binding and pass it to MMotion.Create to reuse it.

public MotionSettings<float, NoOptions> ToMotionSettings()
Return value
Returns
MotionSettings<float, NoOptions>

AsMotionBuilder

Copy the current configuration into a single-use generic float builder.

public MotionBuilder<float, NoOptions, FloatMotionAdapter> AsMotionBuilder()
Return value
Returns
MotionBuilder<float, NoOptions, FloatMotionAdapter>

WithEase

Choose the curve that maps normalized time to progress. When used with Bind, an AnimationCurve is sampled from a snapshot taken at bind time.

public FloatMotionBuilder WithEase(Easing easing)
Parameters and return value
easing
Easing Easing function mapping normalized time to progress.
Returns
FloatMotionBuilder
public FloatMotionBuilder WithEase(Ease ease)
Parameters and return value
ease
Ease Easing function mapping normalized time to progress.
Returns
FloatMotionBuilder
public FloatMotionBuilder WithEase(AnimationCurve animationCurve)
Parameters and return value
animationCurve
AnimationCurve Unity AnimationCurve with its keys and pre/post wrap modes.
Returns
FloatMotionBuilder

WithImmediateBind

Pass false to suppress the initial write at bind time, for example on a later sequence child targeting the same property.

public FloatMotionBuilder WithImmediateBind(bool enabled = true)
Parameters and return value
enabled = true
bool Whether to enable this setting.
Returns
FloatMotionBuilder

WithCancelOnError

Choose whether an exception from the bound setter cancels this tween.

public FloatMotionBuilder WithCancelOnError(bool enabled = true)
Parameters and return value
enabled = true
bool Whether to enable this setting.
Returns
FloatMotionBuilder

WithDelay

Set a delay in seconds and choose which loops receive it. skipValuesDuringDelay controls writes while waiting.

public FloatMotionBuilder WithDelay(float delay, DelayType delayType = DelayType.FirstLoop, bool skipValuesDuringDelay = true)
Parameters and return value
delay
float Delay before interpolation, in seconds.
delayType = DelayType.FirstLoop
DelayType Apply the delay once or before every loop.
skipValuesDuringDelay = true
bool Whether to skip setter writes during a delay.
Returns
FloatMotionBuilder

WithLoops

Set the loop count and LoopType. Stop an infinite loop by canceling it.

public FloatMotionBuilder WithLoops(int loops, LoopType loopType = LoopType.Restart)
Parameters and return value
loops
int Loop count. Use -1 for an infinite loop.
loopType = LoopType.Restart
LoopType How progress is evaluated on successive passes.
Returns
FloatMotionBuilder

WithOnLoopComplete

Register a callback that receives the completed loop count at a loop boundary.

public FloatMotionBuilder WithOnLoopComplete(Action<int> callback)
Parameters and return value
callback
Action<int> Register a callback that receives the completed loop count at a loop boundary.
Returns
FloatMotionBuilder

WithOnComplete

Register work to run on completion, including explicit completion.

public FloatMotionBuilder WithOnComplete(Action action)
Parameters and return value
action
Action Register work to run on completion, including explicit completion.
Returns
FloatMotionBuilder

WithDebugName

Set a name for identifying the tween in the Editor or a Development Build.

public FloatMotionBuilder WithDebugName(string debugName)
Parameters and return value
debugName
string Name used to identify the tween while debugging.
Returns
FloatMotionBuilder

WithOnCancel

Register work to run when the motion is canceled.

public FloatMotionBuilder WithOnCancel(Action action)
Parameters and return value
action
Action Register work to run when the motion is canceled.
Returns
FloatMotionBuilder

RunWithoutBinding

Schedule without a value setter and return a handle for timing and callbacks.

public MotionHandle RunWithoutBinding()
Return value
Returns
MotionHandle

Bind

Schedule the tween with a value setter. Stateful overloads pass the bound state after the interpolated value.

public MotionHandle Bind(Action<float> setter)
Parameters and return value
setter
Action<float> Callback receiving the sampled value.
Returns
MotionHandle
public MotionHandle Bind<T>(T state, Action<float, T> setter)
    where T : class
Parameters and return value
state
T State passed to the setter after the interpolated value.
setter
Action<float, T> Callback receiving the sampled value.
Returns
MotionHandle
public MotionHandle Bind<T1, T2>(T1 state0, T2 state1, Action<float, T1, T2> setter)
    where T1 : class
    where T2 : class
Parameters and return value
state0
T1 State passed to the setter after the interpolated value.
state1
T2 State passed to the setter after the interpolated value.
setter
Action<float, T1, T2> Callback receiving the sampled value.
Returns
MotionHandle
public MotionHandle Bind<T1, T2, T3>(T1 state0, T2 state1, T3 state2, Action<float, T1, T2, T3> setter)
    where T1 : class
    where T2 : class
    where T3 : class
Parameters and return value
state0
T1 State passed to the setter after the interpolated value.
state1
T2 State passed to the setter after the interpolated value.
state2
T3 State passed to the setter after the interpolated value.
setter
Action<float, T1, T2, T3> Callback receiving the sampled value.
Returns
MotionHandle

Related types