EditorGUILayout.VerticalScope
Disposable helper class for managing EditorGUILayout.BeginVertical / EditorGUILayout.EndVertical.
Read time 1 minuteLast updated 11 days ago
Definition
- Type: Class
- Namespace: UnityEditor
- Assembly: UnityEditor.CoreModule
- Inherits from: Scope
- Implements: IDisposable
public class EditorGUILayout.VerticalScope : GUI.Scope, IDisposable
Remarks
This is an extension to GUILayout.VerticalScope. It can be used for making compound controls

Vertical Compound group.
Examples
using UnityEngine;using UnityEditor;// Create a Vertical Compound Buttonclass VerticalScopeExample : EditorWindow{ [MenuItem("Examples/Vertical scope usage")] static void Init() { var window = GetWindow<VerticalScopeExample>(); window.Show(); } void OnGUI() { using (var v = new EditorGUILayout.VerticalScope("Button")) { if (GUI.Button(v.rect, GUIContent.none)) Debug.Log("Go here"); GUILayout.Label("I'm inside the button"); GUILayout.Label("So am I"); } }}
Constructors
Constructor | Description |
|---|---|
| VerticalScope(UnityEngine.GUILayoutOption[]) | Create a new VerticalScope and begin the corresponding vertical group. |
| VerticalScope(UnityEngine.GUIStyle,UnityEngine.GUILayoutOption[]) | Create a new VerticalScope and begin the corresponding vertical group. |
Properties
Property | Description |
|---|---|
| rect | The rect of the vertical group. |