EditorGUI.LabelField 标签字段

static function LabelField (position : Rect, label : string, label2 : string) : void

Parameters参数

Description描述

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

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

EditorGUI.LabelField 标签字段

Shows a label in an editor window with the seconds since the editor started
在编辑器显示一个标签,自编辑器开始秒数。

// Shows a label in the editor with the seconds since the editor started
//显示一个自编辑器开始记秒的标签
class EditorGUILabelField extends EditorWindow {
	@MenuItem("Examples/EditorGUI Label Usage")
	static function Init() {
		var window = GetWindow(EditorGUILabelField);
		window.Show();
	}
	function OnGUI() {
		EditorGUI.LabelField(Rect(3,3,position.width, 20),
		"Time since start: ",
		EditorApplication.timeSinceStartup.ToString());
		this.Repaint();
	}
}
最后修改:2011年6月22日 Wednesday 10:48

本脚本参考基于Unity 3.4.1f5

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