Custom Editor for Directories

Hey,
I’ve been trying for some time now to create a custom editor for an directory using this as a reference:

[CustomEditor(typeof(UnityEngine.Object))]
public class ObjectInspectorEditor : Editor {
    public override void OnInspectorGUI (){
        // do something
    }
}

but unity does not call my custom inspector. And I have no idea why. I also tried to use object instead of UnityEngine.Object. Same result :confused:

Ok I managed to find the problem. I had to make the editor also the editor for the child classes for UnityEngine.Object.

[CustomEditor(typeof(UnityEngine.Object), true)]