Class Animation<TValue>
Base class for any transition between two values of type TValue
.
Inheritance
Animation<TValue>
Inherited Members
Namespace: Ritchie.Toolbox.Animation
Assembly: Ritchie.Toolbox.dll
Syntax
public abstract class Animation<TValue> : Animation, IAnimation, IAnimationHandle where TValue : struct
Type Parameters
Name | Description |
---|---|
TValue | The type of value being transitioned. Only value types are permitted. |
Constructors
Animation(CurveFunction, float, InterpolationFunction<TValue>, TValue, TValue, Action<TValue>)
Creates a new instance of the Animation<TValue> class.
Declaration
protected Animation(CurveFunction curve, float duration, InterpolationFunction<TValue> interpolator, TValue from, TValue to, Action<TValue> callback)
Parameters
Type | Name | Description |
---|---|---|
CurveFunction | curve | The curve function to use for blending between the |
float | duration | The duration, in seconds, of the transition. |
InterpolationFunction<TValue> | interpolator | A compatible InterpolationFunction<T> method. |
TValue | from | The value to start from. |
TValue | to | The value to blend toward. |
Action<TValue> | callback | A callback to be executed at each step of the transition. |
Methods
OnUpdate(float)
Method that's called each time the animation is updated.
Declaration
protected override void OnUpdate(float transitionPercentage)
Parameters
Type | Name | Description |
---|---|---|
float | transitionPercentage | A value between 0.0 and 1.0 representing the animation's progress. |