Class SerializedPropertyHelper | Cinemachine | 2.4.0
docs.unity3d.com
    Show / Hide Table of Contents

    Class SerializedPropertyHelper

    Helpers for the editor

    Inheritance
    Object
    SerializedPropertyHelper
    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<Func<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<Func<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
    Object

    PropertyName(Expression<Func<Object>>)

    Declaration
    public static string PropertyName(Expression<Func<object>> exp)
    Parameters
    Type Name Description
    Expression<Func<Object>> exp
    Returns
    Type Description
    String
    Examples

    "m_MyField";

    MyClass myclass = null; SerializedPropertyHelper.PropertyName( () => myClass.m_MyField);

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023