CustomInspector problem

Before writing a custom inspector to add some details related to source files (specifically .cs, but could be anything), I thought it would be good to create a simple override inspector as a starting point. How hard could it be, right?

However, the following does not deliver the expected results - that of the default inspector behavior.

What’s wrong/missing?

using UnityEditor;

[CustomEditor(typeof(MonoScript))]
public class BrokenCustomInspector : Editor
{
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();    //DrawDefaultInspector(); has the same effect
    }
}

thanks in advance.

To draw the default inspector you should not call the base’s method, instead you should.
call DrawDefaultInspector() Take a look at scripting reference page for Editor class to learn more.
Also you are trying to write insepctors for MonoScript which is an Editor type and not a runtime one and Inspectors can only be written for components and not other data types. So your class should be either a component or be a children of it (direct or indirect).

DrawDefaultInspector is the default inspector for MonoBehaviour scripts. All other built-in types have a specialized custom inspector or are handled directly by the inspector window.

I suggest to download ILSpy (which can also decompile to C#) and take a look into the UnityEditor.dll. There you will find all built-in stuff. Most of the built-in classes are “internal”, so you can’t derive your own classes from them, but you can copy the original source and create your own custom inspector.