Custom inspector for AnimatorStateTransition

Is there a way to make a custom AnimatorStateTransition inspector?
Usual way does not work…

@dlyargsu

Usual way does not work…
not really…

it still does work the usual way, you might have just missed something…
that is, Unity already has its own CustomEditor applied to the AnimatorStateTransition class…

therefore, unless your own CustomEditor has its isFallback property set to false, Unity’s own implementation will be prioritized, thus your CustomEditor is ignored.

oh! and if you’d like to have your own CustomEditor shown when more than one AnimatorStateTransition is selected, you’ll have to add the CanEditMultipleObjects attribute as well like so (if you do add it, keep in mind to handle the Editor.targets array appropriately):

using UnityEditor;
using UnityEditor.Animations;

[CustomEditor(typeof(AnimatorStateTransition), isFallback = false), CanEditMultipleObjects]
internal class AnimatorStateTransitionEditor : Editor
{
    override public void OnInspectorGUI()
    {
        // TODO: your own inspector GUI implementation here...
    }
}

other than that, here’s a naive example (if I haven’t deleted it yet…): stuff.../AnimatorStateTransitionEditor.cs at main · ophura/stuff... · GitHub

Edit:
I tried to do the same thing within an older Unity version,

but that didn’t work…

the one that worked for me the first time was: 2021.3.24f1 :slight_smile: and the above advice isn’t necessary, you can completely ignore the isFallback property and you’ll be fine (as long as you’re using a newer Unity version of course).

as for now, I couldn’t figure out a way yet for older versions…