Scopes

Concrete DrawGUI.Scope implementations that wrap Unity's IMGUI Begin/End patterns into IDisposable using blocks. Each scope file is a static partial class DrawGUI extension that adds factory methods (for creation) and extension methods on Scope (for chaining). All 13 scopes follow the same pattern: store state in OnBegin(), restore it in OnEnd().

Architecture

spinner

Scope Inventory

Root Scopes

Scope
Factory Method
Description

DrawGUI.Colorize(color)

Temporarily changes GUI.color, GUI.backgroundColor, or GUI.contentColor

DrawGUI.FlexibleSpace(begin, end)

Inserts GUILayout.FlexibleSpace() at scope begin and/or end

DrawGUI.ReadonlyIf(condition)

Conditionally disables GUI via EditorGUI.BeginDisabledGroup

Box Scopes

Scope
Factory Method
Description

DrawGUI.Box(...)

Sirenix-styled box container with optional label

DrawGUI.BoxHeader()

Sirenix box header region (use inside a Box scope)

FadeGroup Scopes

Scope
Factory Method
Description

DrawGUI.FadeGroup(key, isExpanded, ...)

Animated expand/collapse with Sirenix fade group

Documented Separately

The following scope subfolders are documented in their own sections:

Subfolder
Scopes
Description

Layout/

HorizontalLayout, VerticalLayout

EditorGUILayout.Begin/EndHorizontal/Vertical wrappers

StyleWith/

StyleWithBorder, StyleWithMargin, StyleWithPadding

Temporarily modify GUIStyle offset properties

Toolbar/

HorizontalToolbar, VerticalToolbar

Sirenix toolbar-styled layout groups

Usage Pattern

Every scope follows the same two-method pattern on DrawGUI:

Basic Usage

See Also

Last updated