Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


EditorGUIUtility

Miscellaneous helper stuff for EditorGUI.
Read time 4 minutesLast updated 2 days ago

Definition

public sealed class EditorGUIUtility : GUIUtility

Static Properties

Property

Description

currentViewWidthThe width of the GUI area for the current EditorWindow or other view. This Property should only be accessed within an OnGUI call.
editingTextFieldIs a text field currently editing text?
fieldWidthThe minimum width in pixels reserved for the fields of Editor GUI controls.
hierarchyModeIs the Editor GUI in hierarchy mode?
isProSkinIs the user currently using the pro skin? (Read Only)
labelWidthThe width in pixels reserved for labels of Editor GUI controls.
pixelsPerPointThe scale of GUI points relative to screen pixels for the current view
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.
textFieldHasSelectionTrue if a text field currently has focused and the text in it is selected.
whiteTextureGet a white texture.
wideModeIs the Editor GUI currently in wide mode?

Static Methods

Method

Description

AddCursorRectAdd a custom mouse pointer to a control.
CommandEventCreates an event that can be sent to another window.
DrawColorSwatchDraw a color swatch.
DrawCurveSwatchDraw a curve swatch.
DrawRegionSwatchDraw swatch with a filled region between two SerializedProperty curves.
FindTextureGets a texture from its source filename. You can load an Editor texture resource by name or a texture from an asset path.
GetBuiltinSkinGet one of the built-in GUI skins, which can be the game view, inspector or Scene view skin as chosen by the parameter.
GetFlowLayoutedRectsLayout list of string items left to right, top to bottom in the given area.
GetIconForObjectGets the custom icon associated with an object. Only GameObjects and MonoScripts have associated custom icons.
GetIconSizeGet the size that has been set using EditorGUIUtility.SetIconSize.
GetMainWindowPositionGets the position of the main window of the Unity Editor. This is the top level Editor Window that contains all the other Editor views, such as the Project Browser, Hierarchy, and Console.
GetObjectPickerControlIDThe controlID of the currently showing object picker.
GetObjectPickerObjectThe object currently selected in the object picker.
HasObjectThumbnailDoes a given class have per-object thumbnails?
IconContentFetch the GUIContent from the Unity builtin resources with the given name.
IsDisplayReferencedByCamerasCheck if any enabled camera can render to a particular display.
LoadLoad a built-in resource.
LoadRequiredLoad a required built-in resource.
ObjectContentReturn a GUIContent object with the name and icon of an Object.
PingObjectPing an object in the Scene like clicking it in an inspector.
PixelsToPointsConvert a Rect from pixel space to point space.
PointsToPixelsConverts a position from point to pixel space.
QueueGameViewInputEventSend an input event into the game.
SetIconForObjectSets a custom icon to associate with a GameObject or MonoScript. The custom icon is displayed in the Scene view and the Inspector.
SetIconSizeSet icons rendered as part of GUIContent to be rendered at a specific size.
SetMainWindowPositionSets position of Unity Editor's main window.
ShowObjectPickerShow the object picker from code.
TrIconContentGets the from Unity built-in resources with the given information or creates a for a GUI element.
TrTextContentGets the from the Unity built-in resources with the given key or creates a for a GUI element.
TrTextContentWithIconGets the from Unity built-in resources with the given information or creates a for a GUI element.

Classes

Class

Description

EditorGUIUtility.IconSizeScopeDisposable scope helper for EditorGUIUtility.GetIconSize / EditorGUIUtility.SetIconSize.
EditorGUIUtility.PropertyCallbackScopeSpecifies a scope in which a callback gets called before each property is rendered.

Inheritance