Class PostProcessEffectEditor<T> | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Class PostProcessEffectEditor<T>

    The class to inherit from when designing custom effect editors.

    Inheritance
    System.Object
    PostProcessEffectBaseEditor
    PostProcessEffectEditor<T>
    Inherited Members
    PostProcessEffectBaseEditor.Repaint()
    PostProcessEffectBaseEditor.OnEnable()
    PostProcessEffectBaseEditor.OnDisable()
    PostProcessEffectBaseEditor.OnInspectorGUI()
    PostProcessEffectBaseEditor.GetDisplayTitle()
    PostProcessEffectBaseEditor.PropertyField(SerializedParameterOverride)
    PostProcessEffectBaseEditor.PropertyField(SerializedParameterOverride, GUIContent)
    Namespace: UnityEditor.Rendering.PostProcessing
    Syntax
    public class PostProcessEffectEditor<T> : PostProcessEffectBaseEditor where T : PostProcessEffectSettings
    Type Parameters
    Name Description
    T

    The effect type to create an editor for

    Methods

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

    Find a serialized parameter override using an expression instead of a string. This is safer as it helps avoiding typos and make code refactoring easier.

    Declaration
    protected SerializedParameterOverride FindParameterOverride<TValue>(Expression<Func<T, TValue>> expr)
    Parameters
    Type Name Description
    Expression<System.Func<T, TValue>> expr

    The expression to parse to reach the parameter override

    Returns
    Type Description
    SerializedParameterOverride

    A SerializedParameterOverride or null if none was found

    Type Parameters
    Name Description
    TValue

    The serialized value type

    Examples
    [Serializable]
    public class MyEffect : PostProcessEffectSettings
    {
        public FloatParameter myParameter = new FloatParameter { value = 1f };
    }
    
    [PostProcessEditor(typeof(MyEffect))]
    public class MyEffectEditor : PostProcessEffectEditor<MyEffect>
    {
        SerializedParameterOverride m_MyParameter;
    
        public override void OnEnable()
        {
            m_MyParameter = FindParameterOverride(x => x.myParameter);
        }
    }
    See Also
    SerializedParameterOverride

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

    Find a serialized property using an expression instead of a string. This is safer as it helps avoiding typos and make code refactoring easier.

    Declaration
    protected SerializedProperty FindProperty<TValue>(Expression<Func<T, TValue>> expr)
    Parameters
    Type Name Description
    Expression<System.Func<T, TValue>> expr

    The expression to parse to reach the property

    Returns
    Type Description
    SerializedProperty

    A or null if none was found

    Type Parameters
    Name Description
    TValue

    The serialized value type

    Remarks

    If you're trying to retrieve a SerializedParameterOverride, you should use FindParameterOverride<TValue>(Expression<Func<T, TValue>>) instead.

    Examples
    [Serializable]
    public class MyEffect : PostProcessEffectSettings
    {
        public float myParameter = 1f;
    }
    
    [PostProcessEditor(typeof(MyEffect))]
    public class MyEffectEditor : PostProcessEffectEditor<MyEffect>
    {
        SerializedProperty m_MyParameter;
    
        public override void OnEnable()
        {
            m_MyParameter = FindProperty(x => x.myParameter);
        }
    }
    See Also
    FindParameterOverride<TValue>(Expression<Func<T, TValue>>)
    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