docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class EditorGUIUtils

    Collection of Editor GUI Utility methods.

    Inheritance
    object
    EditorGUIUtils
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEditor.MARS
    Assembly: Unity.MARS.Editor.dll
    Syntax
    [MovedFrom("Unity.MARS")]
    public static class EditorGUIUtils

    Methods

    FindSerializedPropertyData(SerializedObject, string)

    Collect all the data associated to a SerializedProperty on a SerializedObject to use the SerializedPropertyData in the GUI

    Declaration
    public static SerializedPropertyData FindSerializedPropertyData(this SerializedObject serializedObject, string propertyName)
    Parameters
    Type Name Description
    SerializedObject serializedObject

    serialized object in an inspector

    string propertyName

    Find serialized property by name.

    Returns
    Type Description
    SerializedPropertyData

    Collected data for drawing gui with SerializedPropertyData

    FindSerializedPropertyData(SerializedProperty)

    Collect all the data associated to a SerializedProperty on a SerializedObject to use the SerializedPropertyData in the GUI

    Declaration
    public static SerializedPropertyData FindSerializedPropertyData(SerializedProperty property)
    Parameters
    Type Name Description
    SerializedProperty property

    SerializedProperty object that data needs to be collected from

    Returns
    Type Description
    SerializedPropertyData

    Collected data for drawing gui with SerializedPropertyData

    GetContent(string)

    Get a GUIContent from input string, with text and tooltip separated by a | pipe character

    Declaration
    public static GUIContent GetContent(string textAndTooltip)
    Parameters
    Type Name Description
    string textAndTooltip

    Combined text and tooltip string, separated by a | pipe character

    Returns
    Type Description
    GUIContent

    The resulting GUIContent

    PropertyField(SerializedPropertyData)

    Draw a property field, with no checkbox

    Declaration
    public static void PropertyField(SerializedPropertyData property)
    Parameters
    Type Name Description
    SerializedPropertyData property

    The property being drawn

    PropertyField(SerializedPropertyData, bool, bool)

    Draw a property field, with no checkbox

    Declaration
    public static void PropertyField(SerializedPropertyData property, bool onlyHideToggle, bool showHideInInspector)
    Parameters
    Type Name Description
    SerializedPropertyData property

    The property being drawn

    bool onlyHideToggle
    bool showHideInInspector

    Force this property to draw despite a HideInInspector attribute

    PropertyField(SerializedPropertyData, SerializedPropertyData)

    Draw a property field, with checkbox if appropriate

    Declaration
    public static void PropertyField(SerializedPropertyData toggleProperty, SerializedPropertyData property)
    Parameters
    Type Name Description
    SerializedPropertyData toggleProperty

    Property representing the checkbox value

    SerializedPropertyData property

    The property being drawn

    PropertyField(SerializedPropertyData, SerializedPropertyData, bool, bool, Color?)

    Draw a property field, with checkbox if appropriate

    Declaration
    public static void PropertyField(SerializedPropertyData toggleProperty, SerializedPropertyData property, bool onlyHideToggle, bool showHideInInspector, Color? overrideColor)
    Parameters
    Type Name Description
    SerializedPropertyData toggleProperty

    Property representing the checkbox value

    SerializedPropertyData property

    The property being drawn

    bool onlyHideToggle
    bool showHideInInspector

    Force this property to draw despite a HideInInspector attribute

    Color? overrideColor

    The color to use, or null for no override

    PropertyField(SerializedPropertyData, SerializedPropertyData, Color?)

    Draw a property field, with checkbox if appropriate

    Declaration
    public static void PropertyField(SerializedPropertyData toggleProperty, SerializedPropertyData property, Color? overrideColor)
    Parameters
    Type Name Description
    SerializedPropertyData toggleProperty

    Property representing the checkbox value

    SerializedPropertyData property

    The property being drawn

    Color? overrideColor

    The color to use, or null for no override

    PropertyField(SerializedPropertyData, SerializedPropertyData, string)

    Draw a property field, with checkbox if appropriate

    Declaration
    public static void PropertyField(SerializedPropertyData toggleProperty, SerializedPropertyData property, string title)
    Parameters
    Type Name Description
    SerializedPropertyData toggleProperty

    Property representing the checkbox value

    SerializedPropertyData property

    The property being drawn

    string title

    The label to display for this property

    PropertyField(SerializedPropertyData, SerializedPropertyData, string, bool, bool)

    Draw a property field, with checkbox if appropriate

    Declaration
    public static void PropertyField(SerializedPropertyData toggleProperty, SerializedPropertyData property, string title, bool onlyHideToggle, bool showHideInInspector)
    Parameters
    Type Name Description
    SerializedPropertyData toggleProperty

    Property representing the checkbox value

    SerializedPropertyData property

    The property being drawn

    string title

    The label to display for this property

    bool onlyHideToggle
    bool showHideInInspector

    Force this property to draw despite a HideInInspector attribute

    PropertyField(SerializedPropertyData, SerializedPropertyData, GUIContent, bool, bool)

    Draw a property field, with checkbox if appropriate

    Declaration
    public static void PropertyField(SerializedPropertyData toggleProperty, SerializedPropertyData property, GUIContent title, bool onlyHideToggle, bool showHideInInspector)
    Parameters
    Type Name Description
    SerializedPropertyData toggleProperty

    Property representing the checkbox value

    SerializedPropertyData property

    The property being drawn

    GUIContent title

    The label to display for this property

    bool onlyHideToggle
    bool showHideInInspector

    Force this property to draw despite a HideInInspector attribute

    PropertyField(SerializedPropertyData, GUIContent, bool)

    Draw a property field, with no checkbox

    Declaration
    public static void PropertyField(SerializedPropertyData property, GUIContent title, bool onlyHideToggle)
    Parameters
    Type Name Description
    SerializedPropertyData property

    The property being drawn

    GUIContent title

    The label to display for this property

    bool onlyHideToggle

    PropertyField(SerializedPropertyData, GUIContent, bool, bool)

    Draw a property field, with no checkbox

    Declaration
    public static void PropertyField(SerializedPropertyData property, GUIContent title, bool onlyHideToggle, bool showHideInInspector)
    Parameters
    Type Name Description
    SerializedPropertyData property

    The property being drawn

    GUIContent title

    The label to display for this property

    bool onlyHideToggle
    bool showHideInInspector

    Force this property to draw despite a HideInInspector attribute

    PropertyFieldInRect(Rect, SerializedPropertyData, SerializedPropertyData)

    Draw a property field within a specified region, with checkbox if appropriate

    Declaration
    public static void PropertyFieldInRect(Rect position, SerializedPropertyData toggleProperty, SerializedPropertyData property)
    Parameters
    Type Name Description
    Rect position

    Where these properties should be drawn

    SerializedPropertyData toggleProperty

    Property representing the checkbox value

    SerializedPropertyData property

    The property being drawn

    PropertyFieldInRect(Rect, SerializedPropertyData, SerializedPropertyData, bool, bool)

    Draw a property field within a specified region, with checkbox if appropriate

    Declaration
    public static void PropertyFieldInRect(Rect position, SerializedPropertyData toggleProperty, SerializedPropertyData property, bool onlyHideToggle, bool showHideInInspector)
    Parameters
    Type Name Description
    Rect position

    Where these properties should be drawn

    SerializedPropertyData toggleProperty

    Property representing the checkbox value

    SerializedPropertyData property

    The property being drawn

    bool onlyHideToggle
    bool showHideInInspector

    Force this property to draw despite a HideInInspector attribute

    PropertyFieldInRect(Rect, SerializedPropertyData, SerializedPropertyData, GUIContent)

    Draw a property field within a specified region, with checkbox if appropriate

    Declaration
    public static void PropertyFieldInRect(Rect position, SerializedPropertyData toggleProperty, SerializedPropertyData property, GUIContent title)
    Parameters
    Type Name Description
    Rect position

    Where these properties should be drawn

    SerializedPropertyData toggleProperty

    Property representing the checkbox value

    SerializedPropertyData property

    The property being drawn

    GUIContent title

    The label to display for this property

    PropertyFieldInRect(Rect, SerializedPropertyData, SerializedPropertyData, GUIContent, bool, bool)

    Draw a property field within a specified region, with checkbox if appropriate

    Declaration
    public static void PropertyFieldInRect(Rect position, SerializedPropertyData toggleProperty, SerializedPropertyData property, GUIContent title, bool onlyHideToggle, bool showHideInInspector)
    Parameters
    Type Name Description
    Rect position

    Where these properties should be drawn

    SerializedPropertyData toggleProperty

    Property representing the checkbox value

    SerializedPropertyData property

    The property being drawn

    GUIContent title

    The label to display for this property

    bool onlyHideToggle
    bool showHideInInspector

    Force this property to draw despite a HideInInspector attribute

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)