docs.unity3d.com
    Show / Hide Table of Contents

    Class EditorGUIUtils

    Collection of Editor GUI Utility methods.

    Inheritance
    Object
    EditorGUIUtils
    Namespace: UnityEditor.MARS
    Syntax
    public static class EditorGUIUtils : object

    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, GUIContent, Boolean)

    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

    Boolean onlyHideToggle

    PropertyField(SerializedPropertyData, GUIContent, Boolean, Boolean)

    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

    Boolean onlyHideToggle
    Boolean showHideInInspector

    Force this property to draw despite a HideInInspector attribute

    PropertyField(SerializedPropertyData, Boolean, Boolean)

    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

    Boolean onlyHideToggle
    Boolean 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, GUIContent, Boolean, Boolean)

    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

    Boolean onlyHideToggle
    Boolean showHideInInspector

    Force this property to draw despite a HideInInspector attribute

    PropertyField(SerializedPropertyData, SerializedPropertyData, Boolean, Boolean, Nullable<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

    Boolean onlyHideToggle
    Boolean showHideInInspector

    Force this property to draw despite a HideInInspector attribute

    Nullable<Color> overrideColor

    The color to use, or null for no override

    PropertyField(SerializedPropertyData, SerializedPropertyData, Nullable<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

    Nullable<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, Boolean, Boolean)

    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

    Boolean onlyHideToggle
    Boolean 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, 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, Boolean, Boolean)

    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

    Boolean onlyHideToggle
    Boolean showHideInInspector

    Force this property to draw despite a HideInInspector attribute

    PropertyFieldInRect(Rect, SerializedPropertyData, SerializedPropertyData, Boolean, Boolean)

    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

    Boolean onlyHideToggle
    Boolean showHideInInspector

    Force this property to draw despite a HideInInspector attribute

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023