Legacy Documentation: Version 5.4
LanguageEnglish
  • C#
  • JS

Script language

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

EditorGUI

class in UnityEditor

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

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.
DelayedDoubleFieldMake a delayed text field for entering doubles.
DelayedFloatFieldMake a delayed text field for entering floats.
DelayedIntFieldMake a delayed text field for entering integers.
DelayedTextFieldMake a delayed text field.
DoubleFieldMake a text field for entering doubles.
DrawPreviewTextureDraws the texture within a rectangle.
DrawRectDraws a filled rectangle of color at the specified position and size within the current editor window.
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.
EnumMaskPopupMake an enum popup selection field for a bitmask.
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.
LongFieldMake a text field for entering long integers.
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.