Editor.OnInspectorGUI 当检视面板GUI

function OnInspectorGUI () : void

Description描述

Implement this function to make a custom inspector.

执行这个函数来一个自定义检视面板。

Inside this function you can add your own custom GUI for the inspector of a specific object class.

这个函数里面可为一个特定对象类的检视面板添加自己自定义GUI。

Note: This function has to be overrided in order to work. Check the example:

注意:这个函数必须重新定义以便工作,检查这个例子:

参见:Editor.DrawDefaultInspector

//Creates a custom Label on the inspector for all the scripts named ScriptName

//为所有名为ScriptName的脚本,在检视面板创建一个自定义标签

// Name of the script you are going to create a custom inspector.

// Make sure you have a ScriptName script in your

//确保有一个ScriptName脚本在项目中,否则将不工作

// project, else this will not work.

@CustomEditor(ScriptName)



class TestOnInspector extends Editor {

	override function OnInspectorGUI () {

		GUILayout.Label("This is a Label in a Custom Inspector");

	}

}
Page last updated: 2011-6-28