AnimationPlugin.core
Use this class to build the animation in your AnimResources. Supports fluent syntax.
Starting point of the animation chain.
Adds a single AnimPiece to the animation chain.
The IAnimPiece to add.
The time (seconds) this AnimPiece takes to finish.
Adds an array of AnimPieces that will play simultaneously.
Time (seconds) these pieces will take to finish.
Loads and plays AnimResources on the GameObject. Manages the animation's state, and provides interface to control
it (Play, Pause, Stop).
The current animation progress. Between 0 and 1. Readonly for now.
The AnimResource that is played.
Default is null
Wheter the animation starts at staring the game/sandbox.
Default is false
Wheter the animation starts from the beginning when reached its end.
Default is false
The relative speed the animation is playing back.
Default is 1f
The original length of the AnimResource multiplied by PlaybackRate
Wheter the animation is currently playing or is stopped. Settable.
Moves the gameObject on an elliptical arc. This path can be a circle/ellipse/circular arc depending on the
parameters.
The size of the path ellipse on the X axis.
Default is 200f
RadiusX's multiplier function.
Default is Const1
The size of the path ellipse on the Y axis.
Default is 200f
RadiusY's multiplier function.
Default is Const1
The starting phase angle on the path in radians. Determines the starting point on the arc. 0 means the most right
point, Pi/2 is the bottom one, and so along.
Default is 0f
The ending phase angle on the path in radians.
Default is 0f
Wheter the movement is combineable with other movement. Even if false, the movement takes place in local space.
Default is true
Use this AnimPiece to implement custom behaviour in the AnimResource.
This function is going to be called at every update, getting the current AnimPercent and the AnimationPlayer
GameObject as argument.
Default does nothing.
This AnimPiece invokes the AnimTickCallback function on every Component which implements ICmpAnimUpdatable on the
AnimationPlayer's GameObject.
Implements random movement based on a simple noise algorithm. The Direction attribute controls the direction of the
movement.
Controls the direction of the random movement. Its length is indifferent, will be normalized.
Default is Vector2.UnitX
The frequency of the direction changes.
Default is 10f
real_frequency := Frequency * FreqencyGen (currentAnimPercent)
Default is Const1
The noise amplitude, the strength of this effect.
Default is 100f
real_Amplitude := Amplitude * AmplitudeGen (currentAnimPercent)
Default is ExponentialDecr
Wheter the movement is combineable with other movement. Even if false, the movement takes place in local space.
Default is true
Simple rotating AnimPiece.
The rotation frequency. 1f means one rotation over the animation.
Default is 1f
The mapping of the angular movement.
Default value is Unity
Wheter this Piece's effect overrides all other rotation.
Default is true
Simple color interpolating AnimPiece.
Color at animation start.
Default is ColorRgba.Black
Color at animation end.
Default is ColorRgba.White
Color interpolating function.
Default is Unity
Move the GameObject on the line between StartPos and EndPos.
Starting position of the animation. Local space.
Default is Vector2.Zero
Final position of the animation. Local space.
Default is Vector2.Zero
Position interpolation function.
Default is Unity
Wheter the movement is combineable with other movement. Even if false, the movement takes place in local space.
Default is true
Moves the animated GameObject along a preinitialized path. The path consists of the segments between the
PathVertices.
MUST BE DECLARED. The local coordinates of the path the animation will follow.
Default is null
If set to false, running every segment takes the same time, the segments' length does not count. Otherwise, the
speeed will be constant.
Default is true
Wheter the movement is combineable with other movement. Even if false, the movement takes place in local space.
Default is true
If set to true, the algorithm automaticallt generates one more segment between the first and last vertex.
Default is false
TODO
TODO
Provides more advanced controls over the trigonometric functions which move the gameObject. Simpler version is
EllipseMovement.
Consists of two trigonometric expression: one in the X, one in the Y direction.
The 'speed' of the trigonometric functions in the X and Y directions.
The frequency of 1 means one period over the animation.
Default is Vector2.One
Frequency multiplier function in the X direction.
Default is Const1
Frequency multiplier function in the Y direction.
Default is Const1
The magnitude of the movement in X and Y direction.
Default is Vector2 (200f, 200f)
Amplitude multiplier function in the X direction.
Default is Const1
Amplitude multiplier function in the Y direction.
Default is Const1
The phase of the trigonometric expression in X and Y direction.
Default is Vector2.Zero
Phase multiplier function in the X direction.
Phase multiplier function in the Y direction.
Wheter the movement is combineable with other movement. Even if false, the movement takes place in local space.
Default is true
Does not do anything during the animation. Useful to introduce waiting times between two animation blocks.
Can control the animation state of the attached GameObject's AnimationPlayer.
Draws a line that connects the GameObject's positions in the last n frame.
Beware! Not very effective.
Color of the line drawn.
How many frames' positions should connect. Don't set this too high.
Building block of the animations.
Initialize runs at the start of the animation.
Tick runs at every update.
Inherit from this class when creating custom AnimResources. Have to implement the InitializePieces method.
Defines a Duality core plugin.
f(x) = 1
f(x) = x
f(x) = 3x^2 - 2x^3
f(x) = sin(2πx)
f(x) = cos(2πx)
f(x) = |sin(2πx)|
f(x) = |cos(2πx)|
f(x) = c
c
f(x) = ax + b
a
b
f(x) = x^n
n
f(x) = (e^(sx) - 1) / (e^s - 1)
s
f(x) = - (e^(sx) - 1) / (e^s - 1) + 1
s
f(x) = sin(2πfx + φ) + c
f
A
φ
c
f(x) = cos(2πfx + φ) + c
f
A
φ
c