As you already noticed the imported animation represented as GameObject with child sprites. A whole animation is controlled by AfterEffectAnimation script with is connected to the parent  GameObject of animation.

We can control animation behaviour by calling AfterEffectAnimation class instance methods.  


Basic Scripting

Let's create AnimationExampleControlle.cs script and attach it to the game object with AfterEffectAnimation script. After this, we can use C# Unity scripting to control behaviour of Animation:

Play Animation

GetComponent<AfterEffectAnimation>().Play ();


Stop Animation

GetComponent<AfterEffectAnimation>().Stop ();


Go to specified frame and Play

GetComponent<AfterEffectAnimation>().GoToAndPlay (15); 


Go to specified frame and Stop

GetComponent<AfterEffectAnimation>().GoToAndStop (15); 


You also may use following properties to get information about animation:

//true if animation is currently playing
public bool isPlaying {get;}

//size of animation (from After Effect editor)
public float width {get;}
public float height{get;}

//total frames number
public int totalFrames {get;}

//last frame index (totalFrames - 1)
public int lastFrame{get;}

//time scale of animation
public float timeScale{get; set};
public float opacity {get; set};

//frame duration (depends from animation FPS) 
public float frameDuration{get;}

//total animation duration in seconds
public float duration{get;}


Using Animation Events

ENTER_FRAME - event with is called once per animation frame, and contains current frame index:

GetComponent<AfterEffectAnimation>().OnEnterFrame += OnEnterFrame;

private void OnEnterFrame (int index) {
	Debug.Log("Current Animation index: " + index);


ANIMATION_COMPLETE - Compete animation event. Only for non-looped animations.

GetComponent<AfterEffectAnimation>().OnAnimationComplete += OnAnimationComplete;

private void OnAnimationComplete () {
	Debug.Log("Animation Complete");


FADE_COMPLETE - Event will be fired after fade animation is complete

float opacityFrom = 1f;
float opacityTo = 0f;
float time = 2f;
AfterEffectAnimation anim = GetComponent<AfterEffectAnimation>();
anim.OnFadeComplete += OnFadeComplete;
anim.AnimateOpacity(opacityFrom, opacityTo, time);

private void OnFadeComplete () {
	Debug.Log("Fade Animation Complete");


Full use example can be founded in the AEAnimationExampleController.cs example script.