Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question How to get the Animator being edited from a SMB property extension.

Discussion in 'Animation' started by ok8596, Oct 7, 2022.

  1. ok8596

    ok8596

    Joined:
    Feb 21, 2014
    Posts:
    40
    I am using State Machine Behaviour to control enemies.
    I created an SMB that specifies the behavior in the current state like this.
    state.png

    I would like to be able to choose Animator Parameters by this property extension, but I could not find a way to access the Animator from OnGUI() of PropertyDrawer.

    I was able to get the currently selected AnimatorState, so I was wondering if there is a way to access the Animator from there, or if there is a way to access the Animator that is currently displayed in the editor?