Version: 2022.2
言語: 日本語

AreaScope

class in UnityEngine

マニュアルに切り替える

説明

BeginArea / EndArea を管理する Disposable ヘルパークラス

BeginArea is called at construction, and EndArea is called when the instance is disposed. By default, any GUI controls made using GUILayout are placed in the top-left corner of the screen. If you want to place a series of automatically laid out controls in an arbitrary area, use GUILayout.BeginArea to define a new area for the automatic layouting system to use.

See Also: BeginArea, EndArea


Explained Area of the example.

using UnityEngine;

public class ExampleClass : MonoBehaviour { void OnGUI() { using (var areaScope = new GUILayout.AreaScope(new Rect(10, 10, 100, 100))) { GUILayout.Button("Click me"); GUILayout.Button("Or me"); } } }

コンストラクタ

GUILayout.AreaScope新しい AreaScope を作成して、対応する領域を開始します。
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961