0
\$\begingroup\$

I extended the Button class with my own variables. I also had to create an Editor script since Unity manually draws the Button's fields into the Inspector. I just need to know what the functions that are called by these two buttons in the Inspector:

image

I've googled the topic and nothing came up in my results.

I'm on Unity 2022

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

I happened to use the Window > Analysis > IMGUI Debugger to inspect the buttons. Fortunately, the call trace to which function is called.

image image 2

Also, since there's a SelectableEditor, I don't have to re-serialize all the properties of the button. I just extend my custom editor class from SelectableEditor like so:

[CustomEditor(typeof(CustomScript))]
public class CustomEditor : SelectableEditor
{
    SerializedProperty customVar;

    protected override void OnEnable()
    {
        base.OnEnable();

        // add code here. for example:
        customVar = serializedObject.FindProperty("animateType");
    }

    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        // add code here. for ex.
        EditorGUILayout.PropertyField(customVar);

        serializedObject.ApplyModifiedProperties();
    }
}
\$\endgroup\$
1
  • \$\begingroup\$ will accept my answer in two days \$\endgroup\$ Commented Jan 9, 2023 at 8:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .