Editor.DrawDefaultInspector 绘制默认检视面板

function DrawDefaultInspector () : bool


Draw the built-in inspector.


Call this function from inside OnInspectorGUI to let draw the automatic inspector. Useful if you only want to add a few buttons to an inspector, but don't want to redo the entire one.



// This example shows a custom inspector for an
// object "MyPlayerEditor", which has two variables, vel (velocity) and ammo.
//显示一个对象MyPlayerEditor的自定义检视面板,其中有两个变量vel (velocity) 和 ammo
class MyPlayerEditor extends Editor {
	function OnInspectorGUI() {
		EditorGUILayout.LabelField ("Some help", "Some other text");

		EditorGUILayout.BeginHorizontal ();
		EditorGUILayout.PrefixLabel ("Speed");
		target.vel = EditorGUILayout.Slider (target.vel, 0, 100);
		EditorGUILayout.EndHorizontal ();

		// Show default inspector property editor
		DrawDefaultInspector ();
Page last updated: 2011-6-28