Files
com.misaki.hdrp-toon/Editor/MeterialEditor/UTSShaderGUI.cs
2025-02-01 23:34:34 +08:00

42 lines
1.3 KiB
C#

using Misaki.ShaderGUI;
using UnityEditor;
using UnityEngine;
namespace Misaki.HdrpToon.Editor
{
public class UTSShaderGUI : ScopedShaderGUI
{
private GUIStyle _headerStyle;
public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties)
{
if (!initialized)
{
OnInitialize(materialEditor, properties);
}
EditorGUILayout.Space(10);
EditorGUILayout.LabelField("HDRP Toon Shader", _headerStyle);
EditorGUILayout.Space(20);
DrawShaderGUI(properties);
}
private void OnInitialize(MaterialEditor materialEditor, MaterialProperty[] properties)
{
AddUIScope(new SurfaceOptionsScope());
AddUIScope(new ShadingColorScope());
AddUIScope(new ShadowScope());
AddUIScope(new SurfaceInputsScope());
AddUIScope(new AmbientScope());
AddUIScope(new RimLightScope());
AddUIScope(new AngelRingScope());
AddUIScope(new OutlineScope());
Initialize(materialEditor, properties);
_headerStyle = new GUIStyle() { fontSize = 25, fontStyle = FontStyle.Bold, alignment = TextAnchor.MiddleCenter };
_headerStyle.normal.textColor = GUI.skin.label.normal.textColor;
}
}
}