Search Unity

Custom MenuItem on Animator graph

Discussion in 'Entity Component System' started by futurlab_xbox, Oct 3, 2019.

  1. futurlab_xbox

    futurlab_xbox

    Joined:
    Nov 5, 2018
    Posts:
    22
    Is it possible to write a custom MenuItem to be used on Animator graphs? Something like:

    Code (CSharp):
    1. [ MenuItem( "CONTEXT/AnimatorState/Remove All Transitions" ) ]
    2. private static void RemoveAllTransitions( MenuCommand command )
    3. {
    4.     // Transition removal logic here
    5. }
    Or

    Code (CSharp):
    1. [ MenuItem( "CONTEXT/AnimatorControllerLayer/Remove Invalid Transitions" ) ]
    2. private static void RemoveInvalidTransitions( MenuCommand command )
    3. {
    4.     // Removes transitions without exit time or conditions
    5. }
    upload_2019-10-3_9-47-34.png