Class TransformAnimatorSpeedSequence
Class for animations which uses a animation speed. It is not possible to add more than one animation to a speed sequence because the speed parameter can have a different meaning for different animations therefore the animation does not have the same duration with the same speed.
Implements
Inherited Members
Namespace: AnimationHelpers
Assembly: cs.temp.dll.dll
Syntax
public class TransformAnimatorSpeedSequence : SpeedAnimationSequence, IAnmationSequence
Methods
AnimationStep(Single)
Declaration
protected override void AnimationStep(float t)
Parameters
Type | Name | Description |
---|---|---|
System.Single | t |
Overrides
CreateCustomAnimation(TransformAnimator, Action<Single>, Single, Single, Func<Single, Single>)
Create a custom animation.
travelTime * speed / travelDistance
Declaration
public static TransformAnimatorSpeedSequence CreateCustomAnimation(TransformAnimator transformAnimator, Action<float> animation, float speed, float distance, Func<float, float> easeFunction = null)
Parameters
Type | Name | Description |
---|---|---|
TransformAnimator | transformAnimator | The TransformAnimator of the transform to animate |
Action<System.Single> | animation | The action to call every step. The step will get the t [0,1] value as a parameter. |
System.Single | speed | The speed of the animation. |
System.Single | distance | The distance the animation needs to travel. |
Func<System.Single, System.Single> | easeFunction | The ease functions to use for the interpolation |
Returns
Type | Description |
---|---|
TransformAnimatorSpeedSequence | it self |
CreateLocalMoveAnimation(TransformAnimator, Vector3, Vector3, Single, Func<Single, Single>)
Create a new Move speed animation which uses the local position of the transform.
Declaration
public static TransformAnimatorSpeedSequence CreateLocalMoveAnimation(TransformAnimator transformAnimator, Vector3 startPosition, Vector3 endPosition, float speed, Func<float, float> easeFunction = null)
Parameters
Type | Name | Description |
---|---|---|
TransformAnimator | transformAnimator | The TransformAnimator of the transform to animate |
Vector3 | startPosition | The start position |
Vector3 | endPosition | The end position |
System.Single | speed | The speed of the animation. When the distance is 1 unity unit with the speed 1 it will take 1 seconds to animate. |
Func<System.Single, System.Single> | easeFunction | The ease functions to use for the interpolation |
Returns
Type | Description |
---|---|
TransformAnimatorSpeedSequence | it self |
CreateLocalRotaionAnimation(TransformAnimator, Quaternion, Quaternion, Single, Func<Single, Single>)
Create a new rotation animation which uses the local rotation of the transform.
Declaration
public static TransformAnimatorSpeedSequence CreateLocalRotaionAnimation(TransformAnimator transformAnimator, Quaternion startRotation, Quaternion endRotation, float speed, Func<float, float> easeFunction = null)
Parameters
Type | Name | Description |
---|---|---|
TransformAnimator | transformAnimator | The TransformAnimator of the transform to animate |
Quaternion | startRotation | The start rotation |
Quaternion | endRotation | The end rotation |
System.Single | speed | The speed of the animation. When the rotation distance is 1 Euler angle and the speed is 1 second the animation will take 1 second. |
Func<System.Single, System.Single> | easeFunction | The ease functions to use for the interpolation |
Returns
Type | Description |
---|---|
TransformAnimatorSpeedSequence | it self |
CreateMoveAnimation(TransformAnimator, Vector3, Vector3, Single, Func<Single, Single>)
Create a new Move speed animation
Declaration
public static TransformAnimatorSpeedSequence CreateMoveAnimation(TransformAnimator transformAnimator, Vector3 startPosition, Vector3 endPosition, float speed, Func<float, float> easeFunction = null)
Parameters
Type | Name | Description |
---|---|---|
TransformAnimator | transformAnimator | The TransformAnimator of the transform to animate |
Vector3 | startPosition | The start position |
Vector3 | endPosition | The end position |
System.Single | speed | The speed of the animation. When the distance is 1 unity unit with the speed 1 it will take 1 seconds to animate. |
Func<System.Single, System.Single> | easeFunction | The ease functions to use for the interpolation |
Returns
Type | Description |
---|---|
TransformAnimatorSpeedSequence | it self |
CreateRotationAnimation(TransformAnimator, Quaternion, Quaternion, Single, Func<Single, Single>)
Create a new rotation animation.
Declaration
public static TransformAnimatorSpeedSequence CreateRotationAnimation(TransformAnimator transformAnimator, Quaternion startRotation, Quaternion endRotation, float speed, Func<float, float> easeFunction = null)
Parameters
Type | Name | Description |
---|---|---|
TransformAnimator | transformAnimator | The TransformAnimator of the transform to animate |
Quaternion | startRotation | The start rotation |
Quaternion | endRotation | The end rotation |
System.Single | speed | The speed of the animation. When the rotation distance is 1 Euler angle and the speed is 1 second the animation will take 1 second. |
Func<System.Single, System.Single> | easeFunction | The ease functions to use for the interpolation |
Returns
Type | Description |
---|---|
TransformAnimatorSpeedSequence | it self |
CreateScaleAnimation(TransformAnimator, Vector3, Vector3, Single, Func<Single, Single>)
Create a new scale animation.
Declaration
public static TransformAnimatorSpeedSequence CreateScaleAnimation(TransformAnimator transformAnimator, Vector3 startScale, Vector3 endScale, float speed, Func<float, float> easeFunction = null)
Parameters
Type | Name | Description |
---|---|---|
TransformAnimator | transformAnimator | The TransformAnimator of the transform to animate |
Vector3 | startScale | The start scale |
Vector3 | endScale | The end scale |
System.Single | speed | The speed of the animation. When the scale has a difference of 1 unit with the speed of 1 it takes 1 second to animate |
Func<System.Single, System.Single> | easeFunction | The ease functions to use for the interpolation |
Returns
Type | Description |
---|---|
TransformAnimatorSpeedSequence | it self |