docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class PropertyFetcherExtensions

    Property fetcher extension class.

    Inheritance
    object
    PropertyFetcherExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEditor.Rendering
    Assembly: Unity.RenderPipelines.Core.Editor.dll
    Syntax
    public static class PropertyFetcherExtensions

    Methods

    Find<TSource, TValue>(SerializedObject, Expression<Func<TSource, TValue>>)

    Retrieves a SerializedProperty by using a lambda expression to reference its containing class and field.

    Declaration
    public static SerializedProperty Find<TSource, TValue>(this SerializedObject obj, Expression<Func<TSource, TValue>> expr)
    Parameters
    Type Name Description
    SerializedObject obj

    The SerializedObject being searched.

    Expression<Func<TSource, TValue>> expr

    A lambda expression pointing to the field within the source class.

    Returns
    Type Description
    SerializedProperty

    The corresponding SerializedProperty, or null if not found.

    Type Parameters
    Name Description
    TSource

    The class type containing the field.

    TValue

    The field type.

    Find<TSource, TValue>(SerializedProperty, Expression<Func<TSource, TValue>>)

    Retrieves a relative SerializedProperty based on a lambda expression pointing to a specific field within the source object.

    Declaration
    public static SerializedProperty Find<TSource, TValue>(this SerializedProperty obj, Expression<Func<TSource, TValue>> expr)
    Parameters
    Type Name Description
    SerializedProperty obj

    The instance of SerializedProperty to begin the search from.

    Expression<Func<TSource, TValue>> expr

    A lambda expression pointing to the field within the source class.

    Returns
    Type Description
    SerializedProperty

    The relative SerializedProperty if found; otherwise, null.

    Type Parameters
    Name Description
    TSource

    The class type containing the field.

    TValue

    The field type.

    In This Article
    Back to top
    Copyright © 2024 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)