Class PropertyFetcher<T>
Serialized property fetcher.
Implements
Inherited Members
Namespace: UnityEditor.Rendering
Assembly: Unity.RenderPipelines.Core.Editor.dll
Syntax
public sealed class PropertyFetcher<T> : IDisposable
Type Parameters
Name | Description |
---|---|
T | Serialized object type. |
Constructors
PropertyFetcher(SerializedObject)
Constructor
Declaration
public PropertyFetcher(SerializedObject obj)
Parameters
Type | Name | Description |
---|---|---|
SerializedObject | obj | Serialized object containing properties to fetch. |
Fields
obj
Serialized object associated with the fetcher.
Declaration
public readonly SerializedObject obj
Field Value
Type | Description |
---|---|
SerializedObject |
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.
To use with extreme caution. It not really get the property but try to find a field with similar name Hence inheritance override of property is not supported. Also variable rename will silently break the search.
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. |