EditorGUILayout.BeginToggleGroup Manual     Reference     Scripting  
Scripting > Editor Classes > EditorGUILayout
EditorGUILayout.BeginToggleGroup

static function BeginToggleGroup (label : string, toggle : bool) : bool

static function BeginToggleGroup (label : GUIContent, toggle : bool) : bool

Parameters

NameDescription
label Label to show above the toggled controls.
toggle Enabled state of the toggle group.

Returns

bool - The enabled state selected by the user.

Description

Begin a vertical group with a toggle to enable or disable all the controls within at once.

See Also: EndToggleGroup.

// Settings
settingsOn = EditorGUILayout.BeginToggleGroup("Settings", settingsOn);
backgroundColor = EditorGUILayout.ColorField(backgroundColor);
soundOn = EditorGUILayout.Toggle(soundOn, "Turn on sound");
EditorGUILayout.EndToggleGroup();