Extension methods for UnityEditor.SerializedProperty
using VariableInfo
.
More...
Static Public Member Functions | |
static VariableInfo[] | GetVariableParents (this SerializedProperty property) |
Get VariableInfo hierarchy by specified UnityEditor.SerializedProperty . More... | |
static VariableInfo | GetVariableInfo (this SerializedProperty property) |
Get a VariableInfo by specified UnityEditor.SerializedProperty . More... | |
static Type | GetValueType (this SerializedProperty property) |
Get the type of the property's value. More... | |
static object | GetValue (this SerializedProperty property) |
Get the value of the property. More... | |
static void | SetValue (this SerializedProperty property, object value) |
Set the value of the property with recording undo. More... | |
static object | GetDeclarer (this SerializedProperty property) |
Get the instance which declares the specified UnityEditor.SerializedProperty . More... | |
Extension methods for UnityEditor.SerializedProperty
using VariableInfo
.
Work with System.Reflection
to access values. Basically okay for user defined fields, and script properties aren't serializable. Depend on SerializedProperty.propertyPath
with exactly the same name to find reflection. But might error with built-in types. E.g., UnityEngine.Bounds
has path "m_Extent" but field "m_Extents" and property "extents".
|
static |
Get VariableInfo
hierarchy by specified UnityEditor.SerializedProperty
.
Steps to reflect from serialized target object to the field the property points to. This works by reflection.
property | Property. |
VariableInfo
array.
|
static |
Get a VariableInfo
by specified UnityEditor.SerializedProperty
.
The VariableInfo
reflects to the field the property point to. This works by reflection.
property | Property. |
VariableInfo
.
|
static |
Get the type of the property's value.
This works by reflection.
property | Property. |
|
static |
Get the value of the property.
When a property editing multi target, return the first value. This works by reflection.
property | Property. |
|
static |
Set the value of the property with recording undo.
This works by reflection, but available for struct
. When a property of reference type value editing multi targets. This will assign the same value instance without cloning.
property | Property. |
value | Value. |
|
static |
Get the instance which declares the specified UnityEditor.SerializedProperty
.
property | Property. |