Home

Awesome

Vortex

Animation library for unity engine built on top of Playable API.

About

Vortex is an animation library for unity engine built on top of Playable API. FAnimator mono behaviour script is the heart of Vortex. It is the equivalent of the Animator component of unity engine. It plays animations, mixes animations and then plays.

Why Vortex

You can play or mix animation clips or controllers anytime without using animator controllers. You can use animator controllers too if you wish.

Example Usage

Let's say you need a sequence of animations, like this -

  1. Play non loop clip A.
  2. Start playing controller A and wait 40 seconds.
  3. Play non loop Clip B.
  4. Mix clip C and D and continue to play for 2 minute.
  5. Start playing controller B.

With vortex it is simply calling a set of methods chained with callbacks; all in a single script, in event single method!

Example Usage

And many more to follow!

How to use it

Add FAnimator component to the gameobject that also has an Animator component.

How to use it

And you are done!

FAnimator settings

Animations comes in three forms:

  1. Unity Animation clip
  2. FAnimation clip
  3. Animator controller

FAnimator can play or Mixes and play all three forms of animation data.

FAnimationClip

FAnimationClip works on top of unity Animation clip but with many extra features. For example, the following code will make the fbx model having “FAnimator” (“anim” variable) to animate with “runclip” or simply put the model will start running.

FAnimation Clip 1

Now let's look at the inspector:

FAnimation Clip 2

So the run clip is a unity clip named “fasRun” and it is looped. There are other three modes we can incorporate. Speed is 1. We can ignore repetition and looping animation time since the mode is set as “loop”. When the animation is started, “light1” is turned on. The “light1” is turned off when the animation ends. When the animation crosses 45%, the “light2” is turned on.

FAnimators can have four modes in total:

  1. Loop
  2. Onetime
  3. Loop ended with time
  4. Play N time

“Looping animation time” is applicable No3 or “loop ended with time” mode. “Repetition” is applicable for No4 or “Play N time” mode. The Start Event or End Event or Middle events can also be accessed with script.

API methods

Followings are the API methods of FAnimator:

Animation Task

Let us take a look at the following code:

Animation Task 1

So what is the task’s implementation? For that, let us look at the inspector:

Animation Task 2

The level designer set it as a “PlaySequence”. PlaySequence is a type of builtin animation task. There are in total six animation tasks built in, for most situations this will suffice but you can of course create your own animation task. Just create a class that does not inherit from UnityEngine.Object(this is by design from unity) and makes it inherit from “IAnimationTask” interface. Of course make the class serializable. And you have made your very own animation task.

Builtin Animation Tasks

Play Animation On Mecanim

Plays an animation that lives inside an animator controller and the animator controller is assigned in the Animator component. This Animator component’s gameobject named “anim”.

Builtin Animations Tasks 1

Play Single Animation

Plays a FAnimation clip.

Builtin Animations Tasks 2

Play Controller

Plays an animator controller.

Builtin Animations Tasks 3

Mix and Play Animations

Builtin Animations Tasks 4

Mix and Play Controllers

Builtin Animations Tasks 5

Play Sequence

Builtin Animations Tasks 6