用户工具

站点工具


侧边栏



Unity3D中文文档

script:unityengine:classes:guilayout.areascope:guilayout.areascope

AreaScope 区域范围

class in UnityEngine

Description 描述

Disposable helper class for managing BeginArea / EndArea.

管理BeginArea / EndArea的可支配的助手类。

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.

BeginArea 在结构中调用,并且当实例被配置时EndArea 被调用。默认情况下,任何GUI使用GUILayout 控制成功后被放置在屏幕的左上角位置。如果你想在任意区域放置一系列的自动布局控制,使用GUILayout.BeginArea去定义新的区域,使用自动布局系统。

Explained Area of the example.

JavaScript:

no example available in JavaScript

C#:

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");
		}
    }
}

Constructors 构造函数

GUILayout.AreaScopeCreate a new AreaScope and begin the corresponding Area.
创建新的区域范围并形成相对应的区域。
script/unityengine/classes/guilayout.areascope/guilayout.areascope.txt · 最后更改: 2016/08/02 05:28 (外部编辑)