Class SerializedPropertyHelper
Helpers for the editor
Inheritance
Namespace: Cinemachine.Editor
Syntax
public static class SerializedPropertyHelper
Methods
FindProperty(SerializedObject, Expression<Func<Object>>)
Declaration
public static SerializedProperty FindProperty(this SerializedObject obj, Expression<Func<object>> exp)
Parameters
Type | Name | Description |
---|---|---|
SerializedObject | obj | |
Expression<System.Func<System.Object>> | exp |
Returns
Type | Description |
---|---|
SerializedProperty |
Examples
mySerializedObject.FindProperty("m_MyField");
MyClass myclass = null; mySerializedObject.FindProperty( () => myClass.m_MyField);
FindPropertyRelative(SerializedProperty, Expression<Func<Object>>)
Declaration
public static SerializedProperty FindPropertyRelative(this SerializedProperty obj, Expression<Func<object>> exp)
Parameters
Type | Name | Description |
---|---|---|
SerializedProperty | obj | |
Expression<System.Func<System.Object>> | exp |
Returns
Type | Description |
---|---|
SerializedProperty |
Examples
mySerializedProperty.FindPropertyRelative("m_MyField");
MyClass myclass = null; mySerializedProperty.FindPropertyRelative( () => myClass.m_MyField);
GetPropertyValue(SerializedProperty)
Get the value of a proprty, as an object
Declaration
public static object GetPropertyValue(SerializedProperty property)
Parameters
Type | Name | Description |
---|---|---|
SerializedProperty | property |
Returns
Type | Description |
---|---|
System.Object |
PropertyName(Expression<Func<Object>>)
Declaration
public static string PropertyName(Expression<Func<object>> exp)
Parameters
Type | Name | Description |
---|---|---|
Expression<System.Func<System.Object>> | exp |
Returns
Type | Description |
---|---|
System.String |
Examples
"m_MyField";
MyClass myclass = null; SerializedPropertyHelper.PropertyName( () => myClass.m_MyField);