Legacy Documentation: Version 5.1
LanguageEnglish
  • C#
  • JS

Script language

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

EditorGUIUtility

class in UnityEditor

/

Inherits from: GUIUtility

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

Switch to Manual

Description

Miscellaneous helper stuff for EditorGUI.

Static Variables

currentViewWidthThe width of the GUI area for the current EditorWindow or other view.
editingTextFieldIs a text field currently editing text?
fieldWidthThe minimum width in pixels reserved for the fields of Editor GUI controls.
hierarchyModeIs the Editor GUI is hierarchy mode?
isProSkinIs the user currently using the pro skin? (Read Only)
labelWidthThe width in pixels reserved for labels of Editor GUI controls.
singleLineHeightGet the height used for a single Editor control such as a one-line EditorGUI.TextField or EditorGUI.Popup.
standardVerticalSpacingGet the height used by default for vertical spacing between controls.
systemCopyBufferThe system copy buffer.
whiteTextureGet a white texture.
wideModeIs the Editor GUI currently in wide mode?

Static Functions

AddCursorRectAdd a custom mouse pointer to a control.
CommandEventCreates an event.
DrawColorSwatchDraw a color swatch.
DrawCurveSwatchDraw a curve swatch.
DrawRegionSwatchDraw swatch with a filled region between two SerializedProperty curves.
FindTextureGet a texture from its source filename.
GetBuiltinSkinGet one of the built-in GUI skins, which can be the game view, inspector or scene view skin as chosen by the parameter.
GetIconSizeGet the size that has been set using SetIconSize.
GetObjectPickerControlIDThe controlID of the currently showing object picker.
GetObjectPickerObjectThe object currently selected in the object picker.
HasObjectThumbnailDoes a given class have per-object thumbnails?
HSVToRGBConvert a set of HSV values to an RGB Color.
IconContentFetch the GUIContent from the Unity builtin resources with the given name.
LoadLoad a built-in resource.
LoadRequiredLoad a built-in resource that has to be there.
LookLikeControlsMake all EditorGUI look like regular controls.
ObjectContentReturn a GUIContent object with the name and icon of an Object.
PingObjectPing an object in a window like clicking it in an inspector.
QueueGameViewInputEventSend an input event into the game.
RenderGameViewCamerasRender all ingame cameras.
RGBToHSVConvert a color from RGB to HSV color space.
SetIconSizeSet icons rendered as part of GUIContent to be rendered at a specific size.
ShowObjectPickerShow the object picker from code.

Inherited members

Static Variables

hasModalWindowA global property, which is true if a ModalWindow is being displayed, false otherwise.
hotControlThe controlID of the current hot control.
keyboardControlThe controlID of the control that has keyboard focus.

Static Functions

GetControlIDGet a unique ID for a control.
GetStateObjectGet a state object from a controlID.
GUIToScreenPointConvert a point from GUI position to screen space.
QueryStateObjectGet an existing state object from a controlID.
RotateAroundPivotHelper function to rotate the GUI around a point.
ScaleAroundPivotHelper function to scale the GUI around a point.
ScreenToGUIPointConvert a point from screen space to GUI position.