Files
com.misaki.hdrp-toon/Editor/Inspector/View/BoxLightAdjustmentView.cs

35 lines
854 B
C#

using Unity.Rendering.HighDefinition.Toon;
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
namespace Unity.Toonshader.Editor
{
[CustomEditor(typeof(BoxLightAdjustment))]
public class BoxLightAdjustmentView : UnityEditor.Editor
{
[SerializeField]
private VisualTreeAsset _visualTreeAsset;
public override VisualElement CreateInspectorGUI()
{
if (_visualTreeAsset == null)
{
return base.CreateInspectorGUI();
}
var boxLightAdjustment = (BoxLightAdjustment)target;
var root = new VisualElement
{
dataSource = target
};
var visualTreeElement = _visualTreeAsset.Instantiate();
root.Add(visualTreeElement);
return root;
}
}
}