Version 3.1.11.0

SirenixEditorGUI class

Namespace: Sirenix.Utilities.Editor
Assembly: Sirenix.Utilities.Editor
public static class SirenixEditorGUI
Collection of various editor GUI functions.
Inheritance
  • System.Object
  • SirenixEditorGUI

Fields

MixedValueDashChar
The mixed value dash character, to show when something has mixed values;
public const string MixedValueDashChar = "—"

Properties

DefaultFadeGroupDuration
Default fade group animation duration.
public static float DefaultFadeGroupDuration { get; set; }
ExpandFoldoutByDefault
Expand foldouts by default.
public static bool ExpandFoldoutByDefault { get; set; }
ShakingAnimationDuration
Shaking animation duration.
public static float ShakingAnimationDuration { get; set; }
ShowButtonResultsByDefault
Show buttons results by default.
public static bool ShowButtonResultsByDefault { get; set; }
TabPageSlideAnimationDuration
Tab page slide animation duration.
public static float TabPageSlideAnimationDuration { get; set; }

Methods

BeginBox(String, Boolean, GUILayoutOption[])
Begins drawing a box. Remember to end with EndToolbarBox().
public static Rect BeginBox(string label, bool centerLabel = false, params GUILayoutOption[] options)
Parameters
System.String label

The label of the box.

System.Boolean centerLabel

If set to true then center label.

UnityEngine.GUILayoutOption[] options

The GUI layout options.

Returns
UnityEngine.Rect

BeginBox(GUIContent, Boolean, GUILayoutOption[])
Begins drawing a box. Remember to end with EndToolbarBox().
public static Rect BeginBox(GUIContent label, bool centerLabel = false, params GUILayoutOption[] options)
Parameters
UnityEngine.GUIContent label

The label of the box.

System.Boolean centerLabel

If set to true then center label.

UnityEngine.GUILayoutOption[] options

The GUI layout options.

Returns
UnityEngine.Rect

The rect of the box.

BeginBox(GUILayoutOption[])
Begins drawing a box. Remember to end with EndToolbarBox().
public static Rect BeginBox(params GUILayoutOption[] options)
Parameters
UnityEngine.GUILayoutOption[] options

The GUI layout options.

Returns
UnityEngine.Rect

BeginBoxHeader()
Begins drawing a box header. Remember to end with EndToolbarBoxHeader().
public static Rect BeginBoxHeader()
Returns
UnityEngine.Rect

BeginFadeGroup(Object, Boolean)
Begins a fade group. Remember to end with EndFadeGroup().
public static bool BeginFadeGroup(object key, bool isVisible)
Parameters
System.Object key

The key for the fade group.

System.Boolean isVisible

Current state of the fade group.

Returns
System.Boolean

BeginFadeGroup(Object, Boolean, Single)
Begins a fade group. Remember to end with EndFadeGroup().
public static bool BeginFadeGroup(object key, bool isVisible, float duration)
Parameters
System.Object key

The key for the fade group.

System.Boolean isVisible

Current state of the fade group.

System.Single duration

The duration of fade in and out.

Returns
System.Boolean

BeginFadeGroup(Object, Boolean, out Single)
Begins a fade group. Remember to end with EndFadeGroup().
public static bool BeginFadeGroup(object key, bool isVisible, out float t)
Parameters
System.Object key

The key for the fade group.

System.Boolean isVisible

Current state of the fade group.

System.Single t

A value between 0 and 1 indicating how expanded the fade group is.

Returns
System.Boolean

BeginFadeGroup(Object, Boolean, out Single, Single)
Begins a fade group. Remember to end with EndFadeGroup().
public static bool BeginFadeGroup(object key, bool isVisible, out float t, float duration)
Parameters
System.Object key

The key for the fade group.

System.Boolean isVisible

Current state of the fade group.

System.Single t

A value between 0 and 1 indicating how expanded the fade group is.

System.Single duration

The duration of fade in and out.

Returns
System.Boolean

BeginFadeGroup(Object, Object, Boolean)
Begins a fade group. Remember to end with EndFadeGroup().
public static bool BeginFadeGroup(object primaryKey, object secondaryKey, bool isVisible)
Parameters
System.Object primaryKey

The primary key for the fade group.

System.Object secondaryKey

The secondly key for the fade group.

System.Boolean isVisible

Current state of the fade group.

Returns
System.Boolean

BeginFadeGroup(Object, Object, Boolean, Single)
Begins a fade group. Remember to end with EndFadeGroup().
public static bool BeginFadeGroup(object primaryKey, object secondaryKey, bool isVisible, float duration)
Parameters
System.Object primaryKey

The primary key for the fade group.

System.Object secondaryKey

The secondly key for the fade group.

System.Boolean isVisible

Current state of the fade group.

System.Single duration

The duration of fade in and out.

Returns
System.Boolean

BeginFadeGroup(Object, String, Boolean)
Begins a fade group. Remember to end with EndFadeGroup().
public static bool BeginFadeGroup(object key, string name, bool isVisible)
Parameters
System.Object key

The key for the fade group.

System.String name

The name of the fade group.

System.Boolean isVisible

Current state of the fade group.

Returns
System.Boolean

BeginFadeGroup(Object, String, Boolean, Single)
Begins a fade group. Remember to end with EndFadeGroup().
public static bool BeginFadeGroup(object key, string name, bool isVisible, float duration)
Parameters
System.Object key

The key for the fade group.

System.String name

The name of the fade group.

System.Boolean isVisible

Current state of the fade group.

System.Single duration

The duration of fade in and out.

Returns
System.Boolean

BeginFadeGroup(Single)
Begins a fade group. Remember to end with EndFadeGroup().
public static bool BeginFadeGroup(float t)
Parameters
System.Single t

The current fading value between 0 and 1.

Returns
System.Boolean

BeginHorizontalAutoScrollBox(Object, GUILayoutOption[])
Begins drawing a horizontal auto scroll box. Remember to end with EndHorizontalAutoScrollBox().
public static Rect BeginHorizontalAutoScrollBox(object key, params GUILayoutOption[] options)
Parameters
System.Object key

The for the field.

UnityEngine.GUILayoutOption[] options

The GUILayout options.

Returns
UnityEngine.Rect

The rect used for the field.

BeginHorizontalPropertyLayout(GUIContent)
public static Rect BeginHorizontalPropertyLayout(GUIContent label)
Parameters
UnityEngine.GUIContent label

Returns
UnityEngine.Rect

BeginHorizontalPropertyLayout(GUIContent, out Rect)
public static Rect BeginHorizontalPropertyLayout(GUIContent label, out Rect labelRect)
Parameters
UnityEngine.GUIContent label

UnityEngine.Rect labelRect

Returns
UnityEngine.Rect

BeginHorizontalToolbar(Single, Int32)
Begins a horizontal toolbar. Remember to end with EndHorizontalToolbar().
public static Rect BeginHorizontalToolbar(float height = 22F, int paddingTop = 4)
Parameters
System.Single height

The height of the toolbar.

System.Int32 paddingTop

Padding for the top of the toolbar.

Returns
UnityEngine.Rect

The rect of the horizontal toolbar.

BeginHorizontalToolbar(GUIStyle, Single, Int32)
Begins a horizontal toolbar. Remember to end with EndHorizontalToolbar().
public static Rect BeginHorizontalToolbar(GUIStyle style, float height = 22F, int topPadding = 4)
Parameters
UnityEngine.GUIStyle style

The style for the toolbar.

System.Single height

The height of the toolbar.

System.Int32 topPadding

The top padding.

Returns
UnityEngine.Rect

The rect of the horizontal toolbar.

BeginIndentedHorizontal(GUILayoutOption[])
Begins a horizontal indentation. Remember to end with EndIndentedHorizontal().
public static void BeginIndentedHorizontal(params GUILayoutOption[] options)
Parameters
UnityEngine.GUILayoutOption[] options

The GUI layout options.

BeginIndentedHorizontal(GUIStyle, GUILayoutOption[])
Begins a horizontal indentation. Remember to end with EndIndentedHorizontal().
public static void BeginIndentedHorizontal(GUIStyle style, params GUILayoutOption[] options)
Parameters
UnityEngine.GUIStyle style

The style of the indentation.

UnityEngine.GUILayoutOption[] options

The GUI layout options.

BeginIndentedVertical(GUILayoutOption[])
Begins a vertical indentation. Remember to end with EndIndentedVertical().
public static Rect BeginIndentedVertical(params GUILayoutOption[] options)
Parameters
UnityEngine.GUILayoutOption[] options

The GUI layout options.

Returns
UnityEngine.Rect

BeginIndentedVertical(GUIStyle, GUILayoutOption[])
Begins a vertical indentation. Remember to end with EndIndentedVertical().
public static Rect BeginIndentedVertical(GUIStyle style, params GUILayoutOption[] options)
Parameters
UnityEngine.GUIStyle style

The style of the indentation.

UnityEngine.GUILayoutOption[] options

The GUI layout options.

Returns
UnityEngine.Rect

BeginInlineBox(GUILayoutOption[])
Begins drawing an inline box. Remember to end with EndInlineBox().
public static Rect BeginInlineBox(params GUILayoutOption[] options)
Parameters
UnityEngine.GUILayoutOption[] options

The GUI layout options.

Returns
UnityEngine.Rect

The rect of the box.

BeginLegendBox(String, Boolean, GUILayoutOption[])
Begins drawing a legend style box. Remember to end with EndLegendBox().
public static Rect BeginLegendBox(string label, bool centerLabel = false, params GUILayoutOption[] options)
Parameters
System.String label

The label for the legend style box.

System.Boolean centerLabel

If true the label will be drawn in the center of the box.

UnityEngine.GUILayoutOption[] options

GUILayout options.

Returns
UnityEngine.Rect

The rect of the box.

BeginLegendBox(GUIContent, Boolean, GUILayoutOption[])
Begins drawing a legend style box. Remember to end with EndLegendBox().
public static Rect BeginLegendBox(GUIContent label, bool centerLabel = false, params GUILayoutOption[] options)
Parameters
UnityEngine.GUIContent label

The label for the legend style box.

System.Boolean centerLabel

If true the label will be drawn in the center of the box.

UnityEngine.GUILayoutOption[] options

GUILayout options.

Returns
UnityEngine.Rect

The rect of the box.

BeginLegendBox(GUILayoutOption[])
Begins drawing a legend style box. Remember to end with EndLegendBox().
public static Rect BeginLegendBox(params GUILayoutOption[] options)
Parameters
UnityEngine.GUILayoutOption[] options

GUILayout options.

Returns
UnityEngine.Rect

The rect of the box.

BeginListItem(Boolean, GUIStyle, Color, Color, Color, Color, GUILayoutOption[])
Begins drawing a list item.
public static Rect BeginListItem(bool allowHover, GUIStyle style, Color evenColor, Color oddColor, Color evenHoverColor, Color oddHoverColor, params GUILayoutOption[] options)
Parameters
System.Boolean allowHover

If set to true the item can be hovered with the mouse.

UnityEngine.GUIStyle style

The style for the vertical list item.

UnityEngine.Color evenColor

The color for even elements.

UnityEngine.Color oddColor

The color for odd elements.

UnityEngine.Color evenHoverColor

The color for even elements when hovered.

UnityEngine.Color oddHoverColor

The color for odd elements when hovered.

UnityEngine.GUILayoutOption[] options

The GUI layout options.

Returns
UnityEngine.Rect

The rect used for the item.

BeginListItem(Boolean, GUIStyle, GUILayoutOption[])
Begins drawing a list item.
public static Rect BeginListItem(bool allowHover = true, GUIStyle style = null, params GUILayoutOption[] options)
Parameters
System.Boolean allowHover

If set to true the item can be hovered with the mouse.

UnityEngine.GUIStyle style

The style for the vertical list item.

UnityEngine.GUILayoutOption[] options

The GUI layout options.

Returns
UnityEngine.Rect

The rect used for the item.

BeginMenuListItem(out Boolean, out Boolean, Boolean)
Begins drawing a menu list item. Remember to end with EndMenuListItem()
public static Rect BeginMenuListItem(out bool isSelected, out bool isMouseDown, bool setAsSelected = false)
Parameters
System.Boolean isSelected

Value indicating whether the item is selected.

System.Boolean isMouseDown

Value indicating if the mouse is pressed on the item.

System.Boolean setAsSelected

If set to true the item is set as selected..

Returns
UnityEngine.Rect

The rect used for the item.

BeginShakeableGroup(Object)
Begins a shakeable group.
public static void BeginShakeableGroup(object key)
Parameters
System.Object key

BeginToggleGroup(Object, ref Boolean, ref Boolean, String)
Begins drawing a toggle group. Remember to end with EndToggleGroup().
public static bool BeginToggleGroup(object key, ref bool enabled, ref bool visible, string title)
Parameters
System.Object key

The key of the group.

System.Boolean enabled

Value indicating if the group is enabled.

System.Boolean visible

Value indicating if the group is visible.

System.String title

The title of the group.

Returns
System.Boolean

Value indicating if the group is toggled.

BeginToggleGroup(Object, ref Boolean, ref Boolean, String, Single)
Begins drawing a toggle group. Remember to end with EndToggleGroup().
public static bool BeginToggleGroup(object key, ref bool enabled, ref bool visible, string title, float animationDuration)
Parameters
System.Object key

The key of the group.

System.Boolean enabled

Value indicating if the group is enabled.

System.Boolean visible

Value indicating if the group is visible.

System.String title

The title of the group.

System.Single animationDuration

Duration of the animation.

Returns
System.Boolean

Value indicating if the group is toggled.

BeginToolbarBox(String, Boolean, GUILayoutOption[])
Begins drawing a box with toolbar style header. Remember to end with EndToolbarBox().
public static Rect BeginToolbarBox(string label, bool centerLabel = false, params GUILayoutOption[] options)
Parameters
System.String label

Label for box header.

System.Boolean centerLabel

If true the label will be drawn in the center of the box header.

UnityEngine.GUILayoutOption[] options

GUILayout options.

Returns
UnityEngine.Rect

The rect of the box.

BeginToolbarBox(GUIContent, Boolean, GUILayoutOption[])
Begins drawing a box with toolbar style header. Remember to end with EndToolbarBox().
public static Rect BeginToolbarBox(GUIContent label, bool centerLabel = false, params GUILayoutOption[] options)
Parameters
UnityEngine.GUIContent label

Label for box header.

System.Boolean centerLabel

If true the label will be drawn in the center of the box header.

UnityEngine.GUILayoutOption[] options

GUILayout options.

Returns
UnityEngine.Rect

The rect of the box.

BeginToolbarBox(GUILayoutOption[])
Begins drawing a box with toolbar style header. Remember to end with EndToolbarBox().
public static Rect BeginToolbarBox(params GUILayoutOption[] options)
Parameters
UnityEngine.GUILayoutOption[] options

GUILayout options.

Returns
UnityEngine.Rect

The rect of the box.

BeginToolbarBoxHeader(Single)
Begins drawing a toolbar style box header. Remember to end with EndToolbarBoxHeader().
public static Rect BeginToolbarBoxHeader(float height = 22F)
Parameters
System.Single height

Returns
UnityEngine.Rect

The rect of the box.

BeginVerticalList(Boolean, Boolean, GUILayoutOption[])
Begins drawing a vertical list.
public static Rect BeginVerticalList(bool drawBorder = true, bool drawDarkBg = true, params GUILayoutOption[] options)
Parameters
System.Boolean drawBorder

If set to true borders will be drawn around the vertical list.

System.Boolean drawDarkBg

If set to true a dark background will be drawn.

UnityEngine.GUILayoutOption[] options

The GUI layout options.

Returns
UnityEngine.Rect

The rect used for the list.

BeginVerticalMenuList(Object)
Begins drawing a vertical menu list.
public static Rect BeginVerticalMenuList(object key)
Parameters
System.Object key

The key for the menu list.

Returns
UnityEngine.Rect

The rect created.

BeginVerticalPropertyLayout(GUIContent)
public static Rect BeginVerticalPropertyLayout(GUIContent label)
Parameters
UnityEngine.GUIContent label

Returns
UnityEngine.Rect

BeginVerticalPropertyLayout(GUIContent, out Rect)
public static Rect BeginVerticalPropertyLayout(GUIContent label, out Rect labelRect)
Parameters
UnityEngine.GUIContent label

UnityEngine.Rect labelRect

Returns
UnityEngine.Rect

CreateAnimatedTabGroup(Object)
Creates a animated tab group.
public static GUITabGroup CreateAnimatedTabGroup(object key)
Parameters
System.Object key

The key for the tab group..

Returns
GUITabGroup

An animated tab group.

DetailedMessageBox(String, String, MessageType, Boolean, Boolean)
Draws a message box that can be expanded to show more details.
public static bool DetailedMessageBox(string message, string detailedMessage, MessageType messageType, bool hideDetailedMessage, bool wide = true)
Parameters
System.String message

The message of the message box.

System.String detailedMessage

The detailed message of the message box.

UnityEditor.MessageType messageType

Type of the message box.

System.Boolean hideDetailedMessage

If set to true the detailed message is hidden.

System.Boolean wide

If set to true the message box will be wide.

Returns
System.Boolean

State of isFolded.

DrawBorders(Rect, Int32, Boolean)
Draws borders around a rect.
public static void DrawBorders(Rect rect, int borderWidth, bool usePlaymodeTint = true)
Parameters
UnityEngine.Rect rect

The rect.

System.Int32 borderWidth

The width of the border on all sides.

System.Boolean usePlaymodeTint

If true applies the user's playmdoe tint to the rect in playmode.

DrawBorders(Rect, Int32, Int32, Int32, Int32, Boolean)
Draws borders around a rect.
public static void DrawBorders(Rect rect, int left, int right, int top, int bottom, bool usePlaymodeTint = true)
Parameters
UnityEngine.Rect rect

The rect.

System.Int32 left

The left size.

System.Int32 right

The right size.

System.Int32 top

The top size.

System.Int32 bottom

The bottom size.

System.Boolean usePlaymodeTint

If true applies the user's playmdoe tint to the rect in playmode.

DrawBorders(Rect, Int32, Int32, Int32, Int32, Color, Boolean)
Draws borders around a rect.
public static void DrawBorders(Rect rect, int left, int right, int top, int bottom, Color color, bool usePlaymodeTint = true)
Parameters
UnityEngine.Rect rect

The rect.

System.Int32 left

The left size.

System.Int32 right

The right size.

System.Int32 top

The top size.

System.Int32 bottom

The bottom size.

UnityEngine.Color color

The color of the borders.

System.Boolean usePlaymodeTint

If true applies the user's playmdoe tint to the rect in playmode.

DrawBorders(Rect, Int32, Color, Boolean)
Draws borders around a rect.
public static void DrawBorders(Rect rect, int borderWidth, Color color, bool usePlaymodeTint = true)
Parameters
UnityEngine.Rect rect

The rect.

System.Int32 borderWidth

The width of the border on all sides.

UnityEngine.Color color

The color of the border.

System.Boolean usePlaymodeTint

If true applies the user's playmdoe tint to the rect in playmode.

DrawColorField(Rect, Color, Boolean, Boolean)
Draws a GUI color field.
public static Color DrawColorField(Rect rect, Color color, bool useAlphaInPreview = true, bool showAlphaBar = false)
Parameters
UnityEngine.Rect rect

The rect to draw the field in.

UnityEngine.Color color

The color of the field.

System.Boolean useAlphaInPreview

If set to true then use alpha in the preview.

System.Boolean showAlphaBar

If set to true then show alpha bar in the preview.

Returns
UnityEngine.Color

The color assigned to the field.

DrawHorizontalLineSeperator(Single, Single, Single, Single)
Draws a horizontal line seperator.
public static void DrawHorizontalLineSeperator(float x, float y, float width, float alpha = 0.5F)
Parameters
System.Single x

System.Single y

System.Single width

System.Single alpha

DrawSolidRect(Single, Single, Color, Boolean)
Draws a solid color rectangle.
public static Rect DrawSolidRect(float width, float height, Color color, bool usePlaymodeTint = true)
Parameters
System.Single width

The width.

System.Single height

The height.

UnityEngine.Color color

The color.

System.Boolean usePlaymodeTint

If true applies the user's playmdoe tint to the rect in playmode.

Returns
UnityEngine.Rect

The rect created.

DrawSolidRect(Rect, Color, Boolean)
Draws a solid color rectangle.
public static void DrawSolidRect(Rect rect, Color color, bool usePlaymodeTint = true)
Parameters
UnityEngine.Rect rect

The rect.

UnityEngine.Color color

The color.

System.Boolean usePlaymodeTint

If true applies the user's playmdoe tint to the rect in playmode.

DrawThickHorizontalSeparator()
Draws a thick horizontal seperator.
public static void DrawThickHorizontalSeparator()
DrawThickHorizontalSeparator(Single, Single)
Draws a thick horizontal seperator.
public static void DrawThickHorizontalSeparator(float topPadding, float bottomPadding)
Parameters
System.Single topPadding

System.Single bottomPadding

DrawThickHorizontalSeperator(Single, Single, Single)
Draws a thick horizontal seperator.
public static void DrawThickHorizontalSeperator(float height, float topPadding, float bottomPadding)
Parameters
System.Single height

System.Single topPadding

System.Single bottomPadding

DrawThickHorizontalSeperator(Rect)
Draws a thick horizontal seperator.
public static void DrawThickHorizontalSeperator(Rect rect)
Parameters
UnityEngine.Rect rect

DrawVerticalLineSeperator(Single, Single, Single, Single)
Draws a vertical line seperator.
public static void DrawVerticalLineSeperator(float x, float y, float height, float alpha = 0.5F)
Parameters
System.Single x

System.Single y

System.Single height

System.Single alpha

DynamicPrimitiveField<T>(GUIContent, T, GUILayoutOption[])
Draws a field for a value of type T - dynamically choosing an appropriate drawer for the type. Currently supported are: char, string, sbyte, byte, short, ushort, int, uint, long, ulong, float, double, decimal, Guid and all enums.
public static T DynamicPrimitiveField<T>(GUIContent label, T value, params GUILayoutOption[] options)
Parameters
UnityEngine.GUIContent label

The label of the fields.

T value

The value to draw.

UnityEngine.GUILayoutOption[] options

The layout options.

Returns
T

The possibly changed value.

Type Parameters
T

The type of the value to draw.

DynamicPrimitiveFieldCanDraw<T>()
Checks whether a given type can be drawn as a dynamic field by DynamicPrimitiveField<T>(GUIContent, T, GUILayoutOption[])
public static bool DynamicPrimitiveFieldCanDraw<T>()
Returns
System.Boolean

True if the type can be drawn, otherwise false.

Type Parameters
T

The type to check.

EndBox()
Ends drawing a box started by any BeginBox.
public static void EndBox()
EndBoxHeader()
Ends drawing a box header started by BeginToolbarBoxHeader(Single),
public static void EndBoxHeader()
EndFadeGroup()
Ends a fade group started by any BeginFadeGroup.
public static void EndFadeGroup()
EndHorizontalAutoScrollBox()
Ends drawing a horizontal auto scroll box started by BeginHorizontalAutoScrollBox(Object, GUILayoutOption[]).
public static void EndHorizontalAutoScrollBox()
EndHorizontalPropertyLayout()
public static void EndHorizontalPropertyLayout()
EndHorizontalToolbar()
Ends a horizontal toolbar started by .
public static void EndHorizontalToolbar()
EndIndentedHorizontal()
Ends a identation horizontal layout group started by BeginIndentedHorizontal(GUILayoutOption[]).
public static void EndIndentedHorizontal()
EndIndentedVertical()
Ends a identation vertical layout group started by BeginIndentedVertical(GUILayoutOption[]).
public static void EndIndentedVertical()
EndInlineBox()
Ends drawing an inline box started by any BeginInlineBox.
public static void EndInlineBox()
EndLegendBox()
Ends the drawing of a legend style box started by BeginLegendBox(GUILayoutOption[])
public static void EndLegendBox()
EndListItem()
Ends drawing a list item started by BeginListItem(Boolean, GUIStyle, GUILayoutOption[]).
public static void EndListItem()
EndMenuListItem()
Ends drawing a menu list item started by BeginMenuListItem(out Boolean, out Boolean, Boolean)
public static void EndMenuListItem()
EndShakeableGroup(Object)
Ends the shakeable group.
public static void EndShakeableGroup(object key)
Parameters
System.Object key

EndToggleGroup()
public static void EndToggleGroup()
EndToolbarBox()
Ends the drawing a box with a toolbar style header started by BeginToolbarBox(GUILayoutOption[]).
public static void EndToolbarBox()
EndToolbarBoxHeader()
Ends the drawing of a toolbar style box header started by BeginToolbarBoxHeader(Single).
public static void EndToolbarBoxHeader()
EndVerticalList()
Ends drawing a vertical list started by BeginVerticalList(Boolean, Boolean, GUILayoutOption[]).
public static void EndVerticalList()
EndVerticalMenuList()
Ends drawing a vertical menu list started by BeginVerticalMenuList(Object)
public static void EndVerticalMenuList()
EndVerticalPropertyLayout()
public static void EndVerticalPropertyLayout()
ErrorMessageBox(String, Boolean)
Draws an error message box.
public static void ErrorMessageBox(string message, bool wide = true)
Parameters
System.String message

The message.

System.Boolean wide

If set to true the message box will be wide.

Foldout(Boolean, String, GUIStyle)
Draws a foldout field where clicking on the label toggles to the foldout too.
public static bool Foldout(bool isVisible, string label, GUIStyle style = null)
Parameters
System.Boolean isVisible

The current state of the foldout.

System.String label

The label of the foldout.

UnityEngine.GUIStyle style

The GUI style.

Returns
System.Boolean

The current state of the foldout.

Foldout(Boolean, GUIContent, GUIStyle)
Draws a foldout field where clicking on the label toggles to the foldout too.
public static bool Foldout(bool isVisible, GUIContent label, GUIStyle style = null)
Parameters
System.Boolean isVisible

The current state of the foldout.

UnityEngine.GUIContent label

The label of the foldout.

UnityEngine.GUIStyle style

The GUI style.

Returns
System.Boolean

Foldout(Boolean, GUIContent, out Rect, GUIStyle)
Draws a foldout field where clicking on the label toggles to the foldout too.
public static bool Foldout(bool isVisible, GUIContent label, out Rect valueRect, GUIStyle style = null)
Parameters
System.Boolean isVisible

The current state of the foldout.

UnityEngine.GUIContent label

The label of the foldout.

UnityEngine.Rect valueRect

The value rect.

UnityEngine.GUIStyle style

The GUI style.

Returns
System.Boolean

Foldout(Rect, Boolean, GUIContent, GUIStyle)
Draws a foldout field where clicking on the label toggles to the foldout too.
public static bool Foldout(Rect rect, bool isVisible, GUIContent label, GUIStyle style = null)
Parameters
UnityEngine.Rect rect

The rect to draw the foldout field in.

System.Boolean isVisible

The current state of the foldout.

UnityEngine.GUIContent label

The label of the foldout.

UnityEngine.GUIStyle style

The style.

Returns
System.Boolean

GetFeatureRichControl(Rect, out Int32, out Boolean)
Creates a control ID that handles keyboard control, focused editor window, indentation and prefix label correctly.
public static Rect GetFeatureRichControl(Rect rect, out int controlId, out bool hasKeyboardFocus)
Parameters
UnityEngine.Rect rect

The rect to make a feature rich control for.

System.Int32 controlId

The created control ID.

System.Boolean hasKeyboardFocus

A value indicating whether or not the control has keyboard focus.

Returns
UnityEngine.Rect

GetFeatureRichControl(Rect, GUIContent, out Int32, out Boolean)
Creates a control ID that handles keyboard control, focused editor window, indentation and prefix label correctly.
public static Rect GetFeatureRichControl(Rect rect, GUIContent label, out int controlId, out bool hasKeyboardFocus)
Parameters
UnityEngine.Rect rect

The rect to make a feature rich control for.

UnityEngine.GUIContent label

The label for the control. Leave null for no label.

System.Int32 controlId

The created control ID.

System.Boolean hasKeyboardFocus

A value indicating whether or not the control has keyboard focus.

Returns
UnityEngine.Rect

GetFeatureRichControlRect(GUIContent, Int32, out Int32, out Boolean, out Rect, GUILayoutOption[])
Gets the feature rich control rect.
public static Rect GetFeatureRichControlRect(GUIContent label, int height, out int controlId, out bool hasKeyboardFocus, out Rect valueRect, params GUILayoutOption[] options)
Parameters
UnityEngine.GUIContent label

System.Int32 height

System.Int32 controlId

System.Boolean hasKeyboardFocus

UnityEngine.Rect valueRect

UnityEngine.GUILayoutOption[] options

Returns
UnityEngine.Rect

GetFeatureRichControlRect(GUIContent, out Int32, out Boolean, out Rect, GUILayoutOption[])
Gets the feature rich control rect.
public static Rect GetFeatureRichControlRect(GUIContent label, out int controlId, out bool hasKeyboardFocus, out Rect valueRect, params GUILayoutOption[] options)
Parameters
UnityEngine.GUIContent label

System.Int32 controlId

System.Boolean hasKeyboardFocus

UnityEngine.Rect valueRect

UnityEngine.GUILayoutOption[] options

Returns
UnityEngine.Rect

HorizontalLineSeparator(Int32)
Draws a horizontal line separator.
public static void HorizontalLineSeparator(int lineWidth = 1)
Parameters
System.Int32 lineWidth

Width of the line.

HorizontalLineSeparator(Color, Int32)
Draws a horizontal line separator.
public static void HorizontalLineSeparator(Color color, int lineWidth = 1)
Parameters
UnityEngine.Color color

The color of the line.

System.Int32 lineWidth

The size of the line.

IconButton(EditorIcon, Int32, Int32, String)
Draws a GUI button with an icon.
public static bool IconButton(EditorIcon icon, int width = 18, int height = 18, string tooltip = "")
Parameters
EditorIcon icon

The editor icon for the button.

System.Int32 width

The width of the button.

System.Int32 height

The height of the button.

System.String tooltip

The tooltip of the button.

Returns
System.Boolean

true if the button was pressed. Otherwise false.

IconButton(EditorIcon, GUIStyle, Int32, Int32, String)
Draws a GUI button with an icon.
public static bool IconButton(EditorIcon icon, GUIStyle style, int width = 18, int height = 18, string tooltip = "")
Parameters
EditorIcon icon

The editor icon for the button.

UnityEngine.GUIStyle style

The GUI style for the button.

System.Int32 width

The width of the button.

System.Int32 height

The height of the button.

System.String tooltip

The tooltip of the button.

Returns
System.Boolean

true if the button was pressed. Otherwise false.

IconButton(Rect, EditorIcon)
Draws a GUI button with an icon.
public static bool IconButton(Rect rect, EditorIcon icon)
Parameters
UnityEngine.Rect rect

The rect to draw the button in.

EditorIcon icon

The editor icon for the button.

Returns
System.Boolean

true if the button was pressed. Otherwise false.

IconButton(Rect, EditorIcon, String)
Draws a GUI button with an icon.
public static bool IconButton(Rect rect, EditorIcon icon, string tooltip)
Parameters
UnityEngine.Rect rect

The rect to draw the button in.

EditorIcon icon

The editor icon for the button.

System.String tooltip

The tooltip of the button.

Returns
System.Boolean

true if the button was pressed. Otherwise false.

IconButton(Rect, EditorIcon, GUIStyle, String)
Draws a GUI button with an icon.
public static bool IconButton(Rect rect, EditorIcon icon, GUIStyle style, string tooltip)
Parameters
UnityEngine.Rect rect

The rect to draw the button in.

EditorIcon icon

The editor icon for the button.

UnityEngine.GUIStyle style

The GUI style for the button.

System.String tooltip

The tooltip of the button.

Returns
System.Boolean

true if the button was pressed. Otherwise false.

IconButton(Rect, Texture, String)
Draws a GUI button with an icon.
public static bool IconButton(Rect rect, Texture icon, string tooltip)
Parameters
UnityEngine.Rect rect

The rect to draw the button in.

UnityEngine.Texture icon

The icon texture.

System.String tooltip

The tooltip for the button.

Returns
System.Boolean

true when the button is pressed.

IconButton(Rect, Texture, GUIStyle, String)
Draws a GUI button with an icon.
public static bool IconButton(Rect rect, Texture icon, GUIStyle style, string tooltip)
Parameters
UnityEngine.Rect rect

The rect to draw the button in.

UnityEngine.Texture icon

The icon texture.

UnityEngine.GUIStyle style

Style for the button.

System.String tooltip

The tooltip for the button.

Returns
System.Boolean

true when the button is pressed.

IconButton(Texture, Int32, Int32, String)
Draws a GUI button with an icon.
public static bool IconButton(Texture icon, int width = 18, int height = 18, string tooltip = "")
Parameters
UnityEngine.Texture icon

The icon texture.

System.Int32 width

Width of the button in pixels.

System.Int32 height

Height of the button in pixels.

System.String tooltip

The tooltip for the button.

Returns
System.Boolean

true when the button is pressed.

IconButton(Texture, GUIStyle, Int32, Int32, String)
Draws a GUI button with an icon.
public static bool IconButton(Texture icon, GUIStyle style, int width = 18, int height = 18, string tooltip = "")
Parameters
UnityEngine.Texture icon

The icon texture.

UnityEngine.GUIStyle style

Style for the button.

System.Int32 width

Width of the button in pixels.

System.Int32 height

Height of the button in pixels.

System.String tooltip

The tooltip for the button.

Returns
System.Boolean

true when the button is pressed.

IconRepeatButton(EditorIcon)
Draws a repeating icon button.
public static bool IconRepeatButton(EditorIcon icon)
Parameters
EditorIcon icon

The icon for the button.

Returns
System.Boolean

true while the button is active. Otherwise false.

IconRepeatButton(EditorIcon, Int32)
Draws a repeating icon button.
public static bool IconRepeatButton(EditorIcon icon, int size)
Parameters
EditorIcon icon

The icon for the button.

System.Int32 size

The size.

Returns
System.Boolean

true while the button is active. Otherwise false.

IconRepeatButton(EditorIcon, Int32, Int32)
Draws a repeating icon button.
public static bool IconRepeatButton(EditorIcon icon, int width, int height)
Parameters
EditorIcon icon

The icon for the button.

System.Int32 width

The width of the button.

System.Int32 height

The height of the button.

Returns
System.Boolean

true while the button is active. Otherwise false.

IndentSpace()
Indents by the current indent value, CurrentIndentAmount.
public static void IndentSpace()
InfoMessageBox(String, Boolean)
Draws a info message box.
public static void InfoMessageBox(string message, bool wide = true)
Parameters
System.String message

The message.

System.Boolean wide

If set to true the message box will be wide.

MenuButton(Int32, String, Boolean, Texture)
Draws a menu button.
public static bool MenuButton(int indent, string text, bool isActive, Texture icon)
Parameters
System.Int32 indent

The indent of the button.

System.String text

The text of the button.

System.Boolean isActive

The current state of the button.

UnityEngine.Texture icon

The texture icon for the button.

Returns
System.Boolean

The current state of the button.

MessageBox(String, Boolean)
Draws a message box.
public static void MessageBox(string message, bool wide = true)
Parameters
System.String message

The message.

System.Boolean wide

If set to true the message box will be wide.

MessageBox(String, MessageType, Boolean)
Draws a message box.
public static void MessageBox(string message, MessageType messageType, bool wide = true)
Parameters
System.String message

The message.

UnityEditor.MessageType messageType

Type of the message.

System.Boolean wide

If set to true the message box will be wide.

MessageBox(String, MessageType, GUIStyle, Boolean)
Draws a message box.
public static void MessageBox(string message, MessageType messageType, GUIStyle style, bool wide = true)
Parameters
System.String message

The message.

UnityEditor.MessageType messageType

Type of the message.

UnityEngine.GUIStyle style

The style.

System.Boolean wide

If set to true the message box will be wide.

SearchField(Rect, String, Boolean, String)
Draws a search field.
public static string SearchField(Rect rect, string searchText, bool forceFocus = false, string controlName = "SirenixSearchField")
Parameters
UnityEngine.Rect rect

System.String searchText

System.Boolean forceFocus

System.String controlName

Returns
System.String

SlideRect(Rect, Int32, Single)
Creates a rect that can be grabbed and pulled to change a value up or down.
public static float SlideRect(Rect rect, int id, float t)
Parameters
UnityEngine.Rect rect

The grabbable rect.

System.Int32 id

The control ID for the sliding.

System.Single t

The current value.

Returns
System.Single

The current value.

SlideRect(Rect, MouseCursor)
Creates a rect that can be grabbed and pulled
public static Vector2 SlideRect(Rect rect, MouseCursor cursor)
Parameters
UnityEngine.Rect rect

The grabbable rect.

UnityEditor.MouseCursor cursor

The cursor.

Returns
UnityEngine.Vector2

The the mouse delta position.

SlideRect(Vector2, Rect)
Creates a rect that can be grabbed and pulled
public static Vector2 SlideRect(Vector2 position, Rect rect)
Parameters
UnityEngine.Vector2 position

The position.

UnityEngine.Rect rect

The grabbable rect.

Returns
UnityEngine.Vector2

The the mouse delta position.

SlideRectDouble(Rect, Int32, Double)
Creates a rect that can be grabbed and pulled to change a value up or down.
public static double SlideRectDouble(Rect rect, int id, double t)
Parameters
UnityEngine.Rect rect

The grabbable rect.

System.Int32 id

The control ID for the sliding.

System.Double t

The current value.

Returns
System.Double

The current value.

SlideRectInt(Rect, Int32, Int32)
Creates a rect that can be grabbed and pulled to change a value up or down.
public static int SlideRectInt(Rect rect, int id, int value)
Parameters
UnityEngine.Rect rect

The grabbable rect.

System.Int32 id

The control ID for the sliding.

System.Int32 value

The current value.

Returns
System.Int32

The current value.

SlideRectLong(Rect, Int32, Int64)
Creates a rect that can be grabbed and pulled to change a value up or down.
public static long SlideRectLong(Rect rect, int id, long t)
Parameters
UnityEngine.Rect rect

The grabbable rect.

System.Int32 id

The control ID for the sliding.

System.Int64 t

The current value.

Returns
System.Int64

The current value.

StartShakingGroup(Object)
Starts the shaking animation of a shaking group.
public static void StartShakingGroup(object key)
Parameters
System.Object key

StartShakingGroup(Object, Single)
Starts the shaking animation of a shaking group.
public static void StartShakingGroup(object key, float duration)
Parameters
System.Object key

System.Single duration

Title(String, String, TextAlignment, Boolean, Boolean)
Draws a nicely formatted title with an optinal sub-title and horizontal ruler.
public static void Title(string title, string subtitle, TextAlignment textAlignment, bool horizontalLine, bool boldLabel = true)
Parameters
System.String title

System.String subtitle

UnityEngine.TextAlignment textAlignment

System.Boolean horizontalLine

System.Boolean boldLabel

ToolbarButton(EditorIcon, Boolean)
Draws a toolbar icon button.
public static bool ToolbarButton(EditorIcon icon, bool ignoreGUIEnabled = false)
Parameters
EditorIcon icon

The icon for the button.

System.Boolean ignoreGUIEnabled

If true, the button clickable while GUI.enabled == false.

Returns
System.Boolean

true if the button was pressed. Otherwise false.

ToolbarButton(String, Boolean)
Draws a toolbar icon button.
public static bool ToolbarButton(string label, bool selected = false)
Parameters
System.String label

The label for the button.

System.Boolean selected

Whether the button state is selected or not

Returns
System.Boolean

true if the button was pressed. Otherwise false.

ToolbarButton(GUIContent, Boolean)
Draws a toolbar icon button.
public static bool ToolbarButton(GUIContent content, bool selected = false)
Parameters
UnityEngine.GUIContent content

The GUI content for the button.

System.Boolean selected

Whether the button state is selected or not

Returns
System.Boolean

true if the button was pressed. Otherwise false.

ToolbarSearchField(String, Boolean, Single)
Draws a toolbar search field.
public static string ToolbarSearchField(string searchText, bool forceFocus = false, float marginLeftRight = 5F)
Parameters
System.String searchText

The current search text.

System.Boolean forceFocus

If set to true the force focus on the field.

System.Single marginLeftRight

The left and right margin.

Returns
System.String

The current search text.

ToolbarTab(Boolean, String)
Draws a toolbar tab.
public static bool ToolbarTab(bool isActive, string label)
Parameters
System.Boolean isActive

If true the tab will be the active tab.

System.String label

Name for the tab.

Returns
System.Boolean

State of isActive.

ToolbarTab(Boolean, GUIContent)
Draws a toolbar tab.
public static bool ToolbarTab(bool isActive, GUIContent label)
Parameters
System.Boolean isActive

If true the tab will be the active tab.

UnityEngine.GUIContent label

Label for the tab.

Returns
System.Boolean

State of isActive.

ToolbarToggle(Boolean, EditorIcon)
Draws a toolbar toggle.
public static bool ToolbarToggle(bool isActive, EditorIcon icon)
Parameters
System.Boolean isActive

Current state of the toggle.

EditorIcon icon

The icon for the toggle.

Returns
System.Boolean

The state of the toggle.

ToolbarToggle(Boolean, String)
Draws a toolbar toggle.
public static bool ToolbarToggle(bool isActive, string text)
Parameters
System.Boolean isActive

Current state of the toggle.

System.String text

The text for the toggle.

Returns
System.Boolean

The state of the toggle.

ToolbarToggle(Boolean, GUIContent)
Draws a toolbar toggle.
public static bool ToolbarToggle(bool isActive, GUIContent content)
Parameters
System.Boolean isActive

Current state of the toggle.

UnityEngine.GUIContent content

The GUI content for the button.

Returns
System.Boolean

The state of the toggle.

ToolbarToggle(Boolean, Texture)
Draws a toolbar toggle.
public static bool ToolbarToggle(bool isActive, Texture icon)
Parameters
System.Boolean isActive

Current state of the toggle.

UnityEngine.Texture icon

The icon for the toggle.

Returns
System.Boolean

The state of the toggle.

VerticalLineSeparator(Int32)
Draws a vertical line separator.
public static void VerticalLineSeparator(int lineWidth = 1)
Parameters
System.Int32 lineWidth

Width of the line.

VerticalLineSeparator(Color, Int32)
Draws a vertical line separator.
public static void VerticalLineSeparator(Color color, int lineWidth = 1)
Parameters
UnityEngine.Color color

The color of the line.

System.Int32 lineWidth

Width of the line.

WarningMessageBox(String, Boolean)
Draws a warning message box.
public static void WarningMessageBox(string message, bool wide = true)
Parameters
System.String message

The message.

System.Boolean wide

If set to true the message box will be wide.