Can I create a custom editor for an abstract class?

I want to know if I can create a custom editor for an abstract class from which several other classes are derived. I want to do this because I want all of the derived classes to have a GUI button on them that can call a method that originates in the abstract base class.

public abstract class BaseClass : ScriptableObject
{
    public virtual void SomeMethod()
    {
         // some code...
    }
}

public class SomeClass : BaseClass
{
    public override void SomeMethod()
    {
         base.SomeMethod;
         // class-specific code
    }
}

public class BaseClassEditor: Editor
{
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        var myTarget = target as BaseClass;

        if (GUILayout.Button("Do Something"))
        {
             myTarget.DoSomething();
        }
    }
}

I’m fairly certain this isn’t going to work because of var myTarget = target as BaseClass;in the editor script. Is there a way that I can get this functionality?

That’s pretty much it, just make sure that the editor is marked to be used for child classes as well;

[CustomEditor (typeof (BaseClass), true)]
public class BaseClassEditor: Editor
{

Even though you are casting the target object to a type of BaseClass, inheritance will still take precedence and the overridden function will be called.