Can DrawDefaultInspector keep its formatting?

I'd like to keep this look in a custom inspector: alt text

Instead, if I override the OnInspectorGUI(), the inspector always loses its formatting and I get this: alt text

It's a simple script, so am I missing something?

using UnityEngine;
using UnityEditor;

[CustomEditor(typeof(Material))]

public class MaterialInspector : Editor {

    public override void OnInspectorGUI()
    {
        DrawDefaultInspector ();
    }
}

1 Answer

1

DrawDefaultInspector only referes to scripts. It just show all public serialized fields with the default type-editor in list form. Any special layout have to be created by yourself. Extending such special layouts (almost all built in components like Transform, Renderer, Material ....) is not posible. You would have to create your own editor from scratch. Some things are really tricky, like arrays, but it is possible if you have the time ;)

That's what I was afraid of. :(

–