EditorGUILayout.LabelField 标签字段

static function LabelField (label : string, label2 : string, params options : GUILayoutOption[]) : void

Parameters参数

Description描述

Make a label field. (Useful for showing read-only info.)

制作一个标签字段。(通常用于显示只读信息)

EditorGUILayout.LabelField 标签字段

Shows a label in the editor (Label) with the seconds since the editor started (Label2).

在编辑器显示一个标签,带有自编辑器开始秒数。

// Shows a label in the editor with the seconds since the editor started
//在编辑器显示一个标签,带有自编辑器开始的秒数
class EditorGUILayoutLabel extends EditorWindow {
	@MenuItem("Examples/Editor GUILayout Label Usage")
	static function Init() {
		var window = GetWindow(EditorGUILayoutLabel);
		window.Show();
	}
	function OnGUI() {
		EditorGUILayout.LabelField("Time since start: ",
		EditorApplication.timeSinceStartup.ToString());
		this.Repaint();
	}
}
最后修改:2011年7月12日 Tuesday 15:23

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。