Unity Editor Inspector Folded offset?

Hi Community,

could you please explain me how to add an offset in the inspector window?

i have a dropdown like this: Screenshot - 0b547bbc730c7420f5c18ee91476391c - Gyazo

and i want to have a small space on the left side, so that it looks like a treeview. is there any possibility to do that?

Thanks in adivce

You need to begin a Horizontal rendering with BeginHorizontal(), then use Spacing(numPixels), then draw your stuff, then EndHorizontal().

I usually have something like this:
I would pass indent 0 or 1 to the first call, and any call within I would just add +1. You can stack this infinitely.

//indent- current indent value
void DrawItem(int indent)

    //indentSize- how many pixels each indent
    GUILayout.Space(indent* indentSize);

    GUILayout.Label("Item Here");

    //Draw another gui item with further indent

This sounds stupid… but you just do this…

 EditorGUILayout.LabelField("Spaced Area");
 myobj.thing = EditorGUILayout.ObjectField(object stuff);

Use space as many times as you need. You can also you the EditorGUI.indentLevel++/--; but it requires more maintenance on your end to make sure you move in and out.