文档

Unity Engine

Unity Engine

GUILayout.VerticalScope

Disposable helper class for managing GUILayout.BeginVertical / GUILayout.EndVertical.
阅读时间1 分钟最后更新于 1 个月前

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.
GUILayoutVertical (GUILayout.VerticalScope)
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.