Search Unity

Animation event with Mecanim

Discussion in 'Scripting' started by Boulou-be, Jul 30, 2014.

  1. Boulou-be

    Boulou-be

    Joined:
    Jul 30, 2014
    Posts:
    3
    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 !
     
  2. hammil

    hammil

    Joined:
    Jun 5, 2013
    Posts:
    56
  3. Boulou-be

    Boulou-be

    Joined:
    Jul 30, 2014
    Posts:
    3
    Yes but I'd like to dot it by code in editor mode. It's for a tool. Any idea ?