docs.unity3d.com
    显示 / 隐藏目录

    Class SerializedPropertyData

    Container class that holds a SerializedProperty together with its Attribute(s). Used to easily get and modify the attribute in an editor.

    Inheritance
    Object
    SerializedPropertyData
    Namespace: Unity.MARS
    Syntax
    public sealed class SerializedPropertyData

    Constructors

    SerializedPropertyData(SerializedProperty, Type, Attribute[])

    Creates a Serialized Parameter with the Serialized property at it's current iterator state.

    Declaration
    public SerializedPropertyData(SerializedProperty property, Type type, Attribute[] attributes)
    Parameters
    Type Name Description
    SerializedProperty property

    SerializedProperty value to store.

    Type type

    Value type of serialized property.

    Attribute[] attributes

    The attributes of the property being stored.

    Properties

    Attributes

    The attributes of the property.

    Declaration
    public Attribute[] Attributes { get; }
    Property Value
    Type Description
    Attribute[]

    DisplayName

    The display name of the serialized property value.

    Declaration
    public string DisplayName { get; }
    Property Value
    Type Description
    String

    Type

    Value type of serialized property.

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

    Value

    The serialized property stored in the parameter.

    Declaration
    public SerializedProperty Value { get; }
    Property Value
    Type Description
    SerializedProperty

    Methods

    AddAttribute<TAttribute>(TAttribute)

    Adds an attribute to the Attributes array.

    Declaration
    public void AddAttribute<TAttribute>(TAttribute attribute)
        where TAttribute : Attribute
    Parameters
    Type Name Description
    TAttribute attribute

    Attribute to add to the Attributes array.

    Type Parameters
    Name Description
    TAttribute

    Type of attribute to be added

    Copy()

    Returns a copy of the SerializedParameter with the SerializedProperty in it's current iterator state.

    Declaration
    public SerializedPropertyData Copy()
    Returns
    Type Description
    SerializedPropertyData

    GetAttribute<TAttribute>()

    Returns the first instance of the attribute type in the Attributes array.

    Declaration
    public TAttribute GetAttribute<TAttribute>()
        where TAttribute : Attribute
    Returns
    Type Description
    TAttribute

    First attribute of type in the Attributes array, null if no attribute.

    Type Parameters
    Name Description
    TAttribute
    返回到顶部
    Copyright © 2023 Unity Technologies — 商标和使用条款
    • 法律条款
    • 隐私政策
    • Cookie
    • 不要出售或分享我的个人信息
    • Your Privacy Choices (Cookie Settings)