Editor.DrawDefaultInspector Manual     Reference     Scripting  
Scripting > Editor Classes > Editor
Editor.DrawDefaultInspector

function DrawDefaultInspector () : bool

Description

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.

See Also: OnInspectorGUI

// This example shows a custom inspector for an
// object "MyPlayerEditor", which has two variables, vel (velocity) and ammo.
@CustomEditor(MyPlayerEditor)
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 ();
}
}