In the source for UI Button inspector, ButtonEditor, they simple extend SelectableEditor like so:
[CustomEditor(typeof(Button), true)]
[CanEditMultipleObjects]
public class ButtonEditor : SelectableEditor
But when I try the same thing:
[CustomEditor(typeof(MyButton), true)]
[CanEditMultipleObjects]
public class MyButtonEditor : ButtonEditor
It gives an error for CustomEditor “Constuctor has 0 parameters but is invoked with 2 arguments” and an error saying ButtonEditor doesn’t exist. Also “using UnityEditor.UI” tells me UI doesn’t exist.
The reason I’m trying to do this, is because I want to be able to set the selected state of the button so I can select multiple at once. I’ve tried to use Toggle but that doesn’t work well for my purposes. The function controlling the selected state is protected so I have to extend the button and if I want to change the functionality. The custom inspector for the button then hides my any public variables from MyButton in the editor.