Class GenericAnimation
A generic animation that calls an update action with the normalized progress (0-1). Useful for simple animations or sequencing multiple animation phases.
public class GenericAnimation : IAnimation
- Inheritance
-
GenericAnimation
- Implements
- Inherited Members
Constructors
GenericAnimation(double, Action<double>, Action?, Func<double, double>?)
Creates a new generic animation.
public GenericAnimation(double duration, Action<double> onUpdate, Action? onComplete = null, Func<double, double>? easing = null)
Parameters
durationdoubleAnimation duration in seconds.
onUpdateAction<double>Callback called each frame with normalized progress (0-1).
onCompleteActionCallback when animation completes.
easingFunc<double, double>Optional easing function (if null, linear progress is passed to onUpdate).
Properties
IsComplete
Gets whether the animation has completed.
public bool IsComplete { get; }
Property Value
Methods
Cancel()
Called when the animation completes or is cancelled.
public void Cancel()
Update(double)
Updates the animation with the elapsed time since the last frame.
public void Update(double deltaTime)
Parameters
deltaTimedoubleTime elapsed since last update in seconds.