GUILayout.BeginHorizontal 开始水平组

static function BeginHorizontal (params options : GUILayoutOption[]) : void
static function BeginHorizontal (style : GUIStyle, params options : GUILayoutOption[]) : void
static function BeginHorizontal (text : string, style : GUIStyle, params options : GUILayoutOption[]) : void
static function BeginHorizontal (image : Texture, style : GUIStyle, params options : GUILayoutOption[]) : void
static function BeginHorizontal (content : GUIContent, style : GUIStyle, params options : GUILayoutOption[]) : void

Parameters参数

Description描述

Begin a Horizontal control group.

开始一个水平控件的组。

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

所有被渲染的控件,在这个组里一个接着一个被水平放置。该组必须调用EndHorizontal关闭。

GUILayout.BeginHorizontal 开始水平组

Horizontal Layout. 水平布局

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void OnGUI() {
		GUILayout.BeginHorizontal("box");
		GUILayout.Button("I'm the first button");
		GUILayout.Button("I'm to the right");
		GUILayout.EndHorizontal();
	}
}
function OnGUI () {
	// Starts a horizontal group
	//开始一个水平组
	GUILayout.BeginHorizontal ("box");

	GUILayout.Button ("I'm the first button");
	GUILayout.Button ("I'm to the right");

	GUILayout.EndHorizontal ();
}
Page last updated: 2011-6-14