Class SpeedAnimationSequence
Abstract class for an animation which uses speed for its animation. (Duration is different with a different distance)
Inheritance
Implements
Inherited Members
Namespace: AnimationHelpers
Assembly: cs.temp.dll.dll
Syntax
public abstract class SpeedAnimationSequence : IAnmationSequence
Constructors
SpeedAnimationSequence(Single, Single, Boolean)
Create a new instance of SpeedAnimationSequence The t value for the interpolation is calculated as follow:
travelTime * speed / travelDistance
Declaration
public SpeedAnimationSequence(float speed, float travelDistance, bool reversed = false)
Parameters
Type | Name | Description |
---|---|---|
System.Single | speed | A multiplier which will be applied to the time the animation is running. |
System.Single | travelDistance | The distance the animation needs to travel |
System.Boolean | reversed | If true start the animation in reversed state |
Fields
_speed
Declaration
protected readonly float _speed
Field Value
Type | Description |
---|---|
System.Single |
_travelDistance
Declaration
protected readonly float _travelDistance
Field Value
Type | Description |
---|---|
System.Single |
Methods
AnimationStep(Single)
Declaration
protected abstract void AnimationStep(float t)
Parameters
Type | Name | Description |
---|---|---|
System.Single | t |
ConstructCoroutine()
Create a coroutine which executes the animation. Can be called by a MonoBehaviour with.
StartCoroutine(animation.ConstructCoroutine());
Declaration
public IEnumerator ConstructCoroutine()
Returns
Type | Description |
---|---|
IEnumerator | The IEnumarator for the coroutine |
Reverse()
reverse the animation
Declaration
public void Reverse()
StartManualAnimation()
Start a manual animation. This will remember the time when this method is called.
Declaration
public void StartManualAnimation()
UpdateAnimation()
Update the animation.
Declaration
public bool UpdateAnimation()
Returns
Type | Description |
---|---|
System.Boolean | True if the animation is finished |