VerticalScope

class in UnityEngine

Switch to Manual

Description

用于管理 BeginVertical/EndVertical 的可处置的 Helper 类。

在该元素内呈现的所有控件都将依次向下布局。必须通过调用 EndVertical 来关闭该组。


Vertical Layout.

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

GUILayout.VerticalScope创建一个新的 VerticalScope 并开始相应的垂直组。