Class SerializedPropertyData
Container class that holds a SerializedProperty
together with its Attribute
(s).
Used to easily get and modify the attribute in an editor.
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 |
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 |
Type Parameters
Name | Description |
---|---|
TAttribute |