Class UniversalRenderPipelineVolumeComponentEditor
The default VolumeComponentEditor implementation for the Universal Render Pipeline (URP). This editor manages custom UI for volume components in the URP context. It handles rendering feature checks and UI warnings for missing features needed by the volume component.
Inheritance
Inherited Members
Namespace: UnityEditor.Rendering.Universal
Assembly: Unity.RenderPipelines.Universal.Editor.dll
Syntax
[SupportedOnRenderPipeline(typeof(UniversalRenderPipelineAsset))]
[CustomEditor(typeof(VolumeComponent), true)]
public class UniversalRenderPipelineVolumeComponentEditor : VolumeComponentEditor
Remarks
This editor class is designed to work with volume components in Unity's URP. It extends the VolumeComponentEditor to customize the inspector UI for volume components and add checks for required renderer features.
When using this editor, ensure that the relevant renderer features for the volume are enabled in the active URP renderer asset. If any required features are missing, a warning will be displayed with an option to open the relevant renderer settings.
Methods
OnBeforeInspectorGUI()
Displays the UI for the volume component and checks for missing renderer features required by the volume.
Declaration
protected override void OnBeforeInspectorGUI()
Overrides
Remarks
This method draws the inspector UI for the volume component and checks whether the necessary renderer features are enabled in the active URP asset. If any required features are missing, a warning box will be displayed. The warning includes a button that opens the active renderer asset for quick modification.
Examples
The OnBeforeInspectorGUI() method is called before rendering the inspector GUI for the volume component, ensuring that feature checks are performed and UI warnings are shown before displaying the inspector.
See Also
OnEnable()
Initializes the editor. It caches the VolumeRequiresRendererFeatures attribute from the target component.
Declaration
public override void OnEnable()
Overrides
Remarks
The OnEnable() method caches the renderer features attribute for the volume component. This ensures that UI elements relying on these features are updated efficiently. This method is called when the editor is first enabled.
Examples
The OnEnable() method is automatically called when the editor is initialized, making it suitable for setting up references and caching.