docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    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
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEditor.MARS
    Assembly: Unity.MARS.Editor.dll
    Syntax
    [MovedFrom("Unity.MARS")]
    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
    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)