Editor.DrawDefaultInspectorfunction DrawDefaultInspector () : boolDescriptionDraw 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 (); } } |
