58 lines
1.7 KiB
C#
58 lines
1.7 KiB
C#
using Misaki.ShaderGUI;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace Misaki.HdrpToon.Editor
|
|
{
|
|
public class UTSShaderGUI : ScopedShaderGUI
|
|
{
|
|
private GUIStyle _headerStyle;
|
|
|
|
public override void ValidateMaterial(Material material)
|
|
{
|
|
UTSAPI.SetupPass(material);
|
|
UTSAPI.SetupKeywords(material);
|
|
UTSAPI.SetupProperties(material);
|
|
}
|
|
|
|
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());
|
|
AddUIScope(new AdvanceScope());
|
|
|
|
Initialize(materialEditor, properties);
|
|
|
|
_headerStyle = new GUIStyle()
|
|
{
|
|
fontSize = 25,
|
|
fontStyle = FontStyle.Bold,
|
|
alignment = TextAnchor.MiddleCenter,
|
|
normal =
|
|
{
|
|
textColor = GUI.skin.label.normal.textColor
|
|
}
|
|
};
|
|
}
|
|
}
|
|
} |