EditorGUIUtility.LookLikeInspector 像检视面板

static function LookLikeInspector () : void

Description描述

Make all EditorGUI look like simplified outline view controls.

使所有EditorGUI看起来像简单大纲视图控件。

This will make the default styles used by EditorGUI look like it does in the inspector.

这将使默认样式使用与EditorGUI,看起来像是检视面板。

EditorGUIUtility.LookLikeInspector 像检视面板

Editor window with "LookLikeInspector" look.

参见: LookLikeControls

// Simple editor window that shows the difference between
// Look like controls and look like inspector
//编辑器窗口显示类似控件和类似检视面板的不同

class LookLikeControlsInspector extends EditorWindow {

	var integer1 : int = 0;
	var float1 : float = 5.5;

	@MenuItem("Examples/Look Like Controls - Inspector")
	static function Init() {
		var window = GetWindow(LookLikeControlsInspector);
		window.Show();
	}

	function OnGUI() {
		EditorGUIUtility.LookLikeInspector ();
			EditorGUILayout.TextField ("Text Field:", "Hello There");
			EditorGUILayout.IntField("Int Field:", integer1);
			EditorGUILayout.FloatField("Float Field:", float1);
		EditorGUILayout.Space();
		EditorGUIUtility.LookLikeControls();
			EditorGUILayout.TextField ("Text Field", "Hello There");
			EditorGUILayout.IntField("Int Field:", integer1);
			EditorGUILayout.FloatField("Float Field:", float1);
	}
}
最后修改:2011年7月15日 Friday 12:39

本脚本参考基于Unity 3.4.1f5

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