GUILayout.VerticalScope
Disposable helper class for managing GUILayout.BeginVertical / GUILayout.EndVertical.
Read time 1 minuteLast updated 10 days ago
Definition
- Type: Class
- Namespace: UnityEngine
- Assembly: UnityEngine.IMGUIModule
- Inherits from: Scope
- Implements: IDisposable
public class GUILayout.VerticalScope : GUI.Scope, IDisposable
Remarks
All controls rendered inside this element will be placed vertically below each other. The group is automatically closed when the scope ends.

Vertical Layout.
Examples
using UnityEngine;public class ExampleClass : MonoBehaviour{ void OnGUI() { // Starts a vertical group using (var verticalScope = new VerticalScope("box")) { GUILayout.Button("I'm the top button"); GUILayout.Button("I'm the bottom button"); } // The group is now ended }}
Constructors
Constructor | Description |
|---|---|
| VerticalScope(System.String,UnityEngine.GUIStyle,UnityEngine.GUILayoutOption[]) | Create a new VerticalScope and begin the corresponding vertical group. |
| VerticalScope(UnityEngine.GUIContent,UnityEngine.GUIStyle,UnityEngine.GUILayoutOption[]) | Create a new VerticalScope and begin the corresponding vertical group. |
| 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. |
| VerticalScope(UnityEngine.Texture,UnityEngine.GUIStyle,UnityEngine.GUILayoutOption[]) | Create a new VerticalScope and begin the corresponding vertical group. |