Files
com.misaki.hdrp-toon/Editor/MeterialEditor/UIScopes/AngelRingScope.cs
Misaki 973f617590 Added new stocking scope to shader gui;
Added new stocking surface feature;
Added unity 6.3 support;

Fixed the issue that ssr weight does not blend ibl and ssr properly;
Fixed the issue that material recive ssr regardless of specular ambient mode;
2025-08-17 13:10:38 +09:00

56 lines
2.6 KiB
C#

using Misaki.ShaderGUI;
using System.Linq;
using UnityEditor;
using UnityEngine;
using static Misaki.HdrpToon.UTSPropertyName.AngelRing;
namespace Misaki.HdrpToon.Editor
{
internal class AngelRingScope : MaterialUIScope<ShaderGUIExpandable>
{
private static class Properties
{
public static MaterialProperty angelRingColor;
public static MaterialProperty angelRingColorMap;
public static MaterialProperty angelRingIntensity;
public static MaterialProperty angelRingOffsetU;
public static MaterialProperty angelRingOffsetV;
}
private static class Styles
{
public static readonly GUIContent angelRingColorText = new("Angel Ring Color", "Specifies the color of the angel ring.");
public static readonly GUIContent angelRingIntensityText = new("Angel Ring Intensity", "Specifies the intensity of the angel ring.");
public static readonly GUIContent angelRingOffsetUText = new("Angel Ring Offset U", "Specifies the offset of the angel ring in the U direction.");
public static readonly GUIContent angelRingOffsetVText = new("Angel Ring Offset V", "Specifies the offset of the angel ring in the V direction.");
}
protected override bool ShowSection => materials.All(mat => mat.HasFeature(SurfaceFeature.AngelRing));
protected override ShaderGUIExpandable ExpandableBit => ShaderGUIExpandable.AngelRing;
protected override GUIContent Header => EditorGUIUtility.TrTextContent("Angel Ring Settings");
protected override void LoadMaterialProperties()
{
Properties.angelRingColor = FindProperty(ANGEL_RING_COLOR);
Properties.angelRingColorMap = FindProperty(ANGEL_RING_COLOR_MAP);
Properties.angelRingIntensity = FindProperty(ANGEL_RING_INTENSITY);
Properties.angelRingOffsetU = FindProperty(ANGEL_RING_OFFSET_U);
Properties.angelRingOffsetV = FindProperty(ANGEL_RING_OFFSET_V);
}
protected override void DrawContent()
{
editor.TexturePropertySingleLine(Styles.angelRingColorText, Properties.angelRingColorMap, Properties.angelRingColor);
editor.ShaderProperty(Properties.angelRingIntensity, Styles.angelRingIntensityText);
editor.ShaderProperty(Properties.angelRingOffsetU, Styles.angelRingOffsetUText);
editor.ShaderProperty(Properties.angelRingOffsetV, Styles.angelRingOffsetVText);
EditorGUILayout.Space();
editor.TextureScaleOffsetProperty(Properties.angelRingColorMap);
}
}
}