Layout

Disposable scope wrappers for Unity's EditorGUILayout.BeginHorizontal/EndHorizontal and BeginVertical/EndVertical pairs. These are the most commonly used scopes in the DrawGUI system, providing safe layout grouping via using blocks with optional style and layout options.

Architecture

spinner

Scopes

Scope
Factory Method
Description

DrawGUI.HorizontalLayout()

Horizontal layout group

DrawGUI.VerticalLayout()

Vertical layout group

Usage Pattern

All Layout scopes follow the standard DrawGUI scope pattern — each has a standalone factory method and a chaining extension method:

// Standalone
using (DrawGUI.VerticalLayout(style, GUILayout.Width(200)))
{
    // vertical content
}

// Chained
using (DrawGUI.VerticalLayout().HorizontalLayout())
{
    // horizontal inside vertical
}

See Also

Last updated