EditorGUI Manual     Reference     Scripting  
Scripting > Editor Classes > EditorGUI
EditorGUI

These work pretty much like the normal GUI functions - and also have matching implementations in EditorGUILayout

Note: This is an editor class. To use it you have to place your script in Assets/Editor inside your project folder. Editor classes are in the UnityEditor namespace so for C# scripts you need to add "using UnityEditor;" at the beginning of the script.

Class Variables
actionKey

Is the platform-dependent "action" modifier key held down? (Read Only)

indentLevel

the indent level of the field labels.

Class Functions
DropShadowLabel

Draws a label with a drop shadow.

LabelField

Make a label field. (Useful for showing read-only info.)

Toggle

Make a toggle.

TextField

Make a text field.

TextArea

Make a text area.

PasswordField

Make a text field where the user can enter a password.

FloatField

Make a text field for entering floats.

IntField

Make a text field for entering integers.

Slider

Make a slider the user can drag to change a value between a min and a max.

IntSlider

Make a slider the user can drag to change an integer value between a min and a max.

MinMaxSlider

Make a special slider the user can use to specify a range between a min and a max.

Popup

Make a generic popup selection field.

EnumPopup

Make an enum popup selection field.

IntPopup

Make an integer popup selection field.

TagField

Make a tag selection field.

LayerField

Make a layer selection field.

ObjectField

Make an object drop slot field.

Vector2Field

Make an X & Y field for entering a Vector2.

Vector3Field

Make an X, Y & Z field for entering a Vector3.

Vector4Field

Make an X, Y, Z & W field for entering a Vector4.

RectField

Make an X, Y, W & H field for entering a Rect.

ColorField

Make a field for selecting a Color.

CurveField

Make a field for editing an AnimationCurve.

InspectorTitlebar

Make an inspector-window-like titlebar.

Foldout

Make a label with a foldout arrow to the left of it.

ProgressBar

Make a progress bar.

PrefixLabel

Make a label in front of some control.

DrawTextureAlpha

Draws the alpha channel of a texture within a rectangle.

DrawPreviewTexture

Draws the texture within a rectangle.

PropertyField

Make a field for SerializedProperty.