Version: 2020.2

LightingWindowEnvironmentSection

class in UnityEditor

切换到手册

描述

覆盖光照窗口环境部分的 Inspector 的基类。

using UnityEditor;
using UnityEditor.Rendering;
using UnityEngine;
using UnityEngine.Rendering;

[ScriptableRenderPipelineExtension(typeof(CustomSRPAsset))] class CustomEnvironmentSection : LightingWindowEnvironmentSection { public override void OnInspectorGUI() { // The following will be displayed instead of the Environment section in the LightingWindow EditorGUILayout.LabelField("My Custom Environment Section !!"); } }

//Below is a custom empty render pipeline only here for explaining the filtering in ScriptableRenderPipelineExtension

class CustomSRP : RenderPipeline { protected override void Render(ScriptableRenderContext context, Camera[] cameras) { /* My custom rendering algorythme */} }

class CustomSRPAsset : RenderPipelineAsset { protected override RenderPipeline CreatePipeline() { return new CustomSRP(); } }

在该示例中,当 CustomSRP 正在使用时,将覆盖光照窗口的环境部分。

公共函数

OnDisable当不再使用此 Inspector 覆盖时,将调用 OnDisable。
OnEnable当使用此 Inspector 覆盖时,将调用 OnEnable。
OnInspectorGUI绘制光照窗口中的环境部分时调用的回调。