Class VolumeComponentListEditor | Core RP Library | 9.0.0-preview.77
docs.unity3d.com
    Show / Hide Table of Contents

    Class VolumeComponentListEditor

    Unity uses this class to draw the user interface for all the settings contained in a VolumeProfile in the Inspector.

    Inheritance
    Object
    VolumeComponentListEditor
    Namespace: UnityEditor.Rendering
    Syntax
    public sealed class VolumeComponentListEditor
    Examples

    A minimal example of how to write a custom editor that displays the content of a profile in the inspector:

    using UnityEngine.Rendering;
    
    [CustomEditor(typeof(VolumeProfile))]
    public class CustomVolumeProfileEditor : Editor
    {
        VolumeComponentListEditor m_ComponentList;
    
        void OnEnable()
        {
            m_ComponentList = new VolumeComponentListEditor(this);
            m_ComponentList.Init(target as VolumeProfile, serializedObject);
        }
    
        void OnDisable()
        {
            if (m_ComponentList != null)
                m_ComponentList.Clear();
        }
    
        public override void OnInspectorGUI()
        {
            serializedObject.Update();
            m_ComponentList.OnGUI();
            serializedObject.ApplyModifiedProperties();
        }
    }

    Constructors

    VolumeComponentListEditor(Editor)

    Creates a new instance of VolumeComponentListEditor to use in an existing editor.

    Declaration
    public VolumeComponentListEditor(Editor editor)
    Parameters
    Type Name Description
    Editor editor

    A reference to the parent editor instance

    Properties

    asset

    A direct reference to the VolumeProfile this editor displays.

    Declaration
    public VolumeProfile asset { get; }
    Property Value
    Type Description
    VolumeProfile

    Methods

    Clear()

    Cleans up the editor and individual VolumeComponentEditor instances. You must call this when the parent editor is disabled or destroyed.

    Declaration
    public void Clear()

    Init(VolumeProfile, SerializedObject)

    Initializes the editor.

    Declaration
    public void Init(VolumeProfile asset, SerializedObject serializedObject)
    Parameters
    Type Name Description
    VolumeProfile asset

    A direct reference to the profile Asset.

    SerializedObject serializedObject

    An instance of the SerializedObject provided by the parent editor.

    OnGUI()

    Draws the editor.

    Declaration
    public void OnGUI()
    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