How to create indent?...

I need to create a small indent next to Sample1/2/3 after Foldout action. Here is a code:

using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;

public class SampleWindow : EditorWindow
{
    bool Colliders;
    bool Other;
    bool Sample1;
    bool Sample2;
    bool Sample3;

    Vector2 scrollView = Vector2.zero;

    [MenuItem("Window/Other/Open Sample Window #M")]
    static void onOpen()
    {
        EditorWindow.GetWindow(typeof(SampleWindow));
    }

    void OnGUI()
    {
        Colliders = EditorGUILayout.Foldout(Colliders, "Colliders");
        if (Colliders)
        {
            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button("Box", GUILayout.MinWidth(115), GUILayout.MaxWidth(135)))
            {
                GameObject build = new GameObject("Box");
                BoxCollider collider = build.AddComponent<BoxCollider>();
                collider.isTrigger = true;
                Selection.activeGameObject = build;
            }
            if (GUILayout.Button("Mesh", GUILayout.MinWidth(115), GUILayout.MaxWidth(135)))
            {
                GameObject build = new GameObject("Mesh");
                build.AddComponent<UnityEngine.MeshCollider>();
                Selection.activeGameObject = build;
            }
            EditorGUILayout.EndHorizontal();
        }

        Other = EditorGUILayout.Foldout(Other, "Other");
        if (Other)
        {
            //Here I need to create indents near to Sample1/2/3 foldouts

            Sample1 = EditorGUILayout.Foldout(Sample1, "Sample1");
            if (Sample1)
            {
            }

            Sample2 = EditorGUILayout.Foldout(Sample2, "Sample2");
            if (Sample2)
            {
            }

            Sample3 = EditorGUILayout.Foldout(Sample3, "Sample1");
            if (Sample3)
            {
            }
        }
    }
}
1 Like

Thank you a lot!

Do not use the General Discussion for support please as its description states.

I’ll move your UI post to the UI forum.