docs.unity3d.com
    Show / Hide Table of Contents

    Class DatumPropertyDrawer

    Base DatumProperty<TValue, TDatum> drawer used to better present the options between constants and ScriptableObject references.

    Inheritance
    Object
    GUIDrawer
    PropertyDrawer
    DatumPropertyDrawer
    AnimationCurveDatumPropertyDrawer
    FloatDatumPropertyDrawer
    IntDatumPropertyDrawer
    StringDatumPropertyDrawer
    Inherited Members
    PropertyDrawer.CreatePropertyGUI(SerializedProperty)
    PropertyDrawer.CanCacheInspectorGUI(SerializedProperty)
    PropertyDrawer.attribute
    PropertyDrawer.fieldInfo
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.XR.CoreUtils.Datums.Editor
    Syntax
    public abstract class DatumPropertyDrawer : PropertyDrawer

    Methods

    GetPropertyHeight(SerializedProperty, GUIContent)

    Calculates the height of the property based on the number of children of the property.

    Declaration
    public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
    Parameters
    Type Name Description
    SerializedProperty property

    The SerializedProperty to make the custom GUI for.

    GUIContent label

    The label of this property.

    Returns
    Type Description
    Single

    The height in pixels.

    Overrides
    PropertyDrawer.GetPropertyHeight(SerializedProperty, GUIContent)

    GetSelectedProperty(SerializedProperty)

    Gets the property that represents the correct variable reference value.

    Declaration
    protected SerializedProperty GetSelectedProperty(SerializedProperty property)
    Parameters
    Type Name Description
    SerializedProperty property

    The SerializedProperty that contains the variable reference values.

    Returns
    Type Description
    SerializedProperty

    If the VariableReference is set to use a constant value, the constant value will be returned, otherwise the variable value will be returned.

    See Also
    DatumProperty<TValue, TDatum>

    OnGUI(Rect, SerializedProperty, GUIContent)

    Draws the property using immediate mode.

    Declaration
    public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
    Parameters
    Type Name Description
    Rect position

    Rectangle on the screen to use for the property GUI.

    SerializedProperty property

    The SerializedProperty to make the custom GUI for.

    GUIContent label

    The label of this property.

    Overrides
    PropertyDrawer.OnGUI(Rect, SerializedProperty, GUIContent)

    See Also

    PropertyDrawer
    DatumProperty<TValue, TDatum>
    Back to top
    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