VerticalScope

Unity · Версия 2020.3 LTS · Scripting

VerticalScope

Описание

Disposable helper class for managing BeginVertical / EndVertical.

All controls rendered inside this element will be placed vertically below each other. The group must be closed with a call to EndVertical.

Вертикальное расположение.
using UnityEngine;

public class ExampleClass : MonoBehaviour
{
    void OnGUI()
    {
        // Запускает вертикальную группу
        using (var verticalScope = new VerticalScope("box"))
        {
            GUILayout.Button("I'm the top button");
            GUILayout.Button("I'm the bottom button");
        }
       // Группа завершена
    }
}

Конструкторы

GUILayout.VerticalScope Создаёт новую вертикальную область и начинает соответствующую вертикальную группу.

Обновлено 17 ноября 2026 г.