Manual     Reference     Scripting  
  
Scripting > Editor Classes > Editor   
  • Menu
  • Overview
  • Runtime Classes
  • Attributes
  • Enumerations
  • Editor Classes
  • Enumerations
  • History
  • Index
  • Editor
  • All Members
  • Variables
  • target
  • Functions
  • DrawDefaultInspector
  • OnInspectorGUI
  • Repaint
  • Messages Sent
  • OnSceneGUI
  • Inherited Variables
  • hideFlags
  • name
  • Inherited Functions
  • GetInstanceID
  • Inherited Messages Sent
  • OnDisable
  • OnEnable
  • Inherited Class Functions
  • CreateInstance
  • Destroy
  • DestroyImmediate
  • DontDestroyOnLoad
  • FindObjectOfType
  • FindObjectsOfType
  • Instantiate
  • operator !=
  • operator ==
  • operator bool

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 "MyPlayer", which has two variables, speed and ammo.
@CustomEditor(MyPlayer)
class MyPlayerEditor extends Editor
{
function OnInspectorGUI()
{
EditorGUILayout.Label ("Some help");

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

// Show default inspector property editor
DrawDefaultInspector ();
}
}