用户工具

站点工具


侧边栏



Unity3D中文文档

script:unityengine:classes:guilayout.horizontalscope:guilayout.horizontalscope

HorizontalScope 水平范围

class in UnityEngine

Description 描述

Disposable helper class for managing BeginHorizontal / EndHorizontal.

管理BeginHorizontal / EndHorizontal的可支配的助手类。

All controls rendered inside this element will be placed horizontally next to each other. The group must be closed with a call to EndHorizontal.

所有在控制器内部渲染的元素将会被彼此挨着水平放置。该组和EndHorizontal调用必须被关闭。

Horizontal Layout.

JavaScript:

#pragma strict
function OnGUI() {
	var horizontalScope: var = new GUILayout.HorizontalScope("box");
	{
		GUILayout.Button("I'm the first button");
		GUILayout.Button("I'm to the right");
	}
	// Now the group is ended.
}

C#:

using UnityEngine;
 
public class ExampleClass : MonoBehaviour {
	void OnGUI() {
		// Starts a horizontal group
		using (var horizontalScope = new GUILayout.HorizontalScope("box")) {
			GUILayout.Button("I'm the first button");
			GUILayout.Button("I'm to the right");
		}
		// Now the group is ended.
	}
}

Constructors

GUILayout.HorizontalScopeCreate a new HorizontalScope and begin the corresponding horizontal group.
创建新的水平范围并形成相对应的水平组。
script/unityengine/classes/guilayout.horizontalscope/guilayout.horizontalscope.txt · 最后更改: 2016/08/02 05:30 (外部编辑)