Show / Hide Table of Contents

Class SpeedAnimationSequence

Abstract class for an animation which uses speed for its animation. (Duration is different with a different distance)

Inheritance
System.Object
SpeedAnimationSequence
TransformAnimatorSpeedSequence
ValueSpeedAnimation<T>
Implements
IAnmationSequence
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
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 This requires StartManualAnimation() to be called again before.

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. This requires StartManualAnimation() to be called before.

Declaration
public bool UpdateAnimation()
Returns
Type Description
System.Boolean

True if the animation is finished

Implements

IAnmationSequence
Back to top Generated by DocFX