docs.unity3d.com
    Show / Hide Table of Contents

    Class DatumProperty<TValue, TDatum>

    Class used as a serialized field in a component for containing a typed value that is either directly serialized as a constant value or a reference to a ScriptableObject container for that data.

    Inheritance
    Object
    DatumProperty<TValue, TDatum>
    AnimationCurveDatumProperty
    FloatDatumProperty
    IntDatumProperty
    StringDatumProperty
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.XR.CoreUtils.Datums
    Syntax
    [Serializable]
    public abstract class DatumProperty<TValue, TDatum>
        where TDatum : Datum<TValue>
    Type Parameters
    Name Description
    TValue

    Value type.

    TDatum

    Datum asset type.

    Constructors

    DatumProperty()

    Default constructor which creates an empty datum asset reference.

    Declaration
    protected DatumProperty()

    DatumProperty(TValue)

    Constructor setting initial value for the embedded constant.

    Declaration
    protected DatumProperty(TValue value)
    Parameters
    Type Name Description
    TValue value

    Initial value.

    DatumProperty(TDatum)

    Constructor setting initial datum asset reference.

    Declaration
    protected DatumProperty(TDatum datum)
    Parameters
    Type Name Description
    TDatum datum

    Datum asset reference.

    Properties

    ConstantValue

    The current constant value used when this property is set to "Use Value".

    Declaration
    protected TValue ConstantValue { get; }
    Property Value
    Type Description
    TValue

    Datum

    The current datum asset reference used when this property is set to "Use Asset".

    Declaration
    protected Datum<TValue> Datum { get; }
    Property Value
    Type Description
    Datum<TValue>

    Value

    Accessor for internal value held by this container. Getter/Setter uses the constant value if this property is set to "Use Value" and the associated datum's value is referenced if this property is set to "Use Asset".

    Declaration
    public TValue Value { get; set; }
    Property Value
    Type Description
    TValue

    Operators

    Implicit(DatumProperty<TValue, TDatum> to TValue)

    Operator making it easy to treat the container property as the underlying internal value.

    Declaration
    public static implicit operator TValue(DatumProperty<TValue, TDatum> datumProperty)
    Parameters
    Type Name Description
    DatumProperty<TValue, TDatum> datumProperty

    Property to get the internal value of.

    Returns
    Type Description
    TValue

    Returns internal value represented by the property.

    See Also

    Datum<T>
    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