Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

EditorGUI

Namespace: UnityEditor

Description

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

Static Variables

actionKeyIs the platform-dependent "action" modifier key held down? (Read Only)
indentLevelThe indent level of the field labels.
showMixedValueMakes the following controls give the appearance of editing multiple different values.

Static Functions

BeginChangeCheckCheck if any control was changed inside a block of code.
BeginDisabledGroupCreate a group of controls that can be disabled.
BeginPropertyCreate a Property wrapper, useful for making regular GUI controls work with SerializedProperty.
BoundsFieldMake Center & Extents field for entering a Bounds.
ColorFieldMake a field for selecting a Color.
CurveFieldMake a field for editing an AnimationCurve.
DrawPreviewTextureDraws the texture within a rectangle.
DrawTextureAlphaDraws the alpha channel of a texture within a rectangle.
DropShadowLabelDraws a label with a drop shadow.
EndChangeCheckEnds a change check started with BeginChangeCheck ().
EndDisabledGroupEnds a disabled group started with BeginDisabledGroup.
EndPropertyEnds a Property wrapper started with BeginProperty.
EnumMaskFieldMake a field for enum based masks.
EnumPopupMake an enum popup selection field.
FloatFieldMake a text field for entering floats.
FocusTextInControlMove keyboard focus to a named text field and begin editing of the content.
FoldoutMake a label with a foldout arrow to the left of it.
GetPropertyHeightGet the height needed for a PropertyField control.
HandlePrefixLabelMake a label for some control.
HelpBoxMake a help box with a message to the user.
InspectorTitlebarMake an inspector-window-like titlebar.
IntFieldMake a text field for entering integers.
IntPopupMake an integer popup selection field.
IntSliderMake a slider the user can drag to change an integer value between a min and a max.
LabelFieldMake a label field. (Useful for showing read-only info.)
LayerFieldMake a layer selection field.
MaskFieldMake a field for masks.
MinMaxSliderMake a special slider the user can use to specify a range between a min and a max.
MultiFloatFieldMake a multi-control with text fields for entering multiple floats in the same line.
MultiPropertyFieldMake a multi-control with several property fields in the same line.
ObjectFieldMake an object field. You can assign objects either by drag and drop objects or by selecting an object using the Object Picker.
PasswordFieldMake a text field where the user can enter a password.
PopupMake a generic popup selection field.
PrefixLabelMake a label in front of some control.
ProgressBarMake a progress bar.
PropertyFieldMake a field for SerializedProperty.
RectFieldMake an X, Y, W & H field for entering a Rect.
SelectableLabelMake a selectable label field. (Useful for showing read-only info that can be copy-pasted.)
SliderMake a slider the user can drag to change a value between a min and a max.
TagFieldMake a tag selection field.
TextAreaMake a text area.
TextFieldMake a text field.
ToggleMake a toggle.
ToggleLeftMake a toggle field where the toggle is to the left and the label immediately to the right of it.
Vector2FieldMake an X & Y field for entering a Vector2.
Vector3FieldMake an X, Y & Z field for entering a Vector3.
Vector4FieldMake an X, Y, Z & W field for entering a Vector4.