Class VolumeComponentListEditor
Unity uses this class to draw the user interface for all the settings contained in a VolumeProfile in the Inspector.
Inherited Members
Namespace: UnityEditor.Rendering
Assembly: Unity.RenderPipelines.Core.Editor.dll
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()