GUI.EndGroup 结束组

static function EndGroup () : void

Description描述

End a group.

Should be attached with GUI.BeginGroup

结束组,和开数组BeginGroup成对使用。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void OnGUI() {
		GUI.BeginGroup(new Rect(Screen.width / 2 - 400, Screen.height / 2 - 300, 800, 600));
		GUI.Box(new Rect(0, 0, 800, 600), "This box is now centered! - here you would put your main menu");
		GUI.EndGroup();
	}
}
function OnGUI () {
	//在屏幕上把GUI控件约束在800x600像素居中的区域内。
	GUI.BeginGroup(new Rect(Screen.width / 2 - 400, Screen.height / 2 - 300, 800, 600));
	//Boxd的坐标将相对于组的左上角0,0
	GUI.Box(new Rect(0,0,800,600),	"This box is now centered! - here you would put your main menu");
	//有开始组,不要忘记要结束组。
	GUI.EndGroup();
} 
Page last updated: 2011-1-14