Select your preferred scripting language. All code snippets will be displayed in this language.
interface in UnityEditor.Experimental
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
CloseFor some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
CloseCustom light inspector class for a RenderPipelineAsset.
When writing a Scriptable Render Pipeline, you do not always want to use default editor for the lights. For example; the render pipeline might not support LightLayers. You can extend this interface in conjunction with the CustomLightEditorAttribute to enable custom Light editor rendering. See Also: CustomLightEditorAttribute, LightEditor.
no example available in JavaScript
using UnityEditor; using UnityEditor.Experimental; using UnityEngine; using UnityEngine.Experimental.Rendering; using UnityEngine.Experimental.Rendering.HDPipeline;
// This is a custom Light Editor for the HDPipeline [CustomLightEditor(typeof(HDRenderPipeline))] public class LightEditor : ICustomLightEditor { public void OnInspectorGUI(UnityEditor.LightEditor lightEditor) { // Draw the default light editor UI lightEditor.DefaultOnInspectorGUI();
var light = lightEditor.target as Light; var additionalData = light.GetComponent<AdditionalLightData>();
// if there is no additional light data // add an option to create it. if (additionalData == null) { if(GUILayout.Button("Add additional light Data")) { light.gameObject.AddComponent<AdditionalLightData>(); } } } }
OnInspectorGUI | Implement this function to make a custom light inspector. |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information