Animation event with Mecanim

Hi everyone,

For our new project we have a gameplay system based on animation events. We had almost the same in a older project.
In the older project we used the Legacy animation system that let us writing events on all animation clips at game start.
With mecanim we can’t access all the animation clips used by an Animator.

As solution, we create all the animation events by writing in each meta file of each animation clip in edit mode.

This solution work. But to prevent potential problems we would like to know two things :

  • Is there a clean solution to write animation events in edit mode. AnimationUtility.SetAnimationEvents only write temporary events (no persistent changes). At reboot of Unity, all animation events are lost.
  • Is there a way to get all the animation clip of an Animator.

Thanks in advance !

Is this what you’re looking for? http://docs.unity3d.com/Manual/animeditor-AnimationEvents.html

Yes but I’d like to dot it by code in editor mode. It’s for a tool. Any idea ?