docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class RelativePropertyFetcher<T>

    Relative property fetcher.

    Inheritance
    object
    RelativePropertyFetcher<T>
    Implements
    IDisposable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEditor.Rendering
    Assembly: Unity.RenderPipelines.Core.Editor.dll
    Syntax
    public sealed class RelativePropertyFetcher<T> : IDisposable
    Type Parameters
    Name Description
    T

    SerializedObject type.

    Constructors

    RelativePropertyFetcher(SerializedProperty)

    Constructor

    Declaration
    public RelativePropertyFetcher(SerializedProperty obj)
    Parameters
    Type Name Description
    SerializedProperty obj

    Serialized object containing properties to fetch.

    Fields

    obj

    Serialized object associated with the fetcher.

    Declaration
    public readonly SerializedProperty obj
    Field Value
    Type Description
    SerializedProperty

    Methods

    Dispose()

    Disposable pattern implementation.

    Declaration
    public void Dispose()

    Find(string)

    Find a property by name.

    Declaration
    public SerializedProperty Find(string str)
    Parameters
    Type Name Description
    string str

    Property name.

    Returns
    Type Description
    SerializedProperty

    Required property if it exists, null otherwise.

    Find<TValue>(Expression<Func<T, TValue>>)

    Find a property based on an expression.

    Use with extreme caution as this method does not directly retrieve the property but instead searches for a field with a similar name. Inheritance and property overrides are not supported, and renaming a variable may break the linkage without warning.

    Declaration
    public SerializedProperty Find<TValue>(Expression<Func<T, TValue>> expr)
    Parameters
    Type Name Description
    Expression<Func<T, TValue>> expr

    Expression for the property.

    Returns
    Type Description
    SerializedProperty

    Required property if it exists, null otherwise.

    Type Parameters
    Name Description
    TValue

    Type of the serialized object.

    Implements

    IDisposable

    Extension Methods

    ReflectionUtils.GetField(object, string)
    ReflectionUtils.GetFields(object)
    ReflectionUtils.Invoke(object, string, params object[])
    ReflectionUtils.SetField(object, string, object)
    AnalyticsUtils.ToNestedColumnWithDefault<T>(T, T, bool)
    AnalyticsUtils.ToNestedColumn<T>(T, T)
    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)