using Misaki.ShaderGUI; using UnityEditor; using UnityEngine; namespace Misaki.HdrpToon.Editor { internal class AngelRingScope : MaterialUIScope { 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 => SurfaceOptionsScope.HasFeature(SurfaceFeatureFlags.AngelRing); protected override ShaderGUIExpandable ExpandableBit => ShaderGUIExpandable.AngelRing; protected override GUIContent Header => EditorGUIUtility.TrTextContent("Angel Ring Settings"); public override void LoadMaterialProperties() { Properties.angelRingColor = FindProperty("_AngelRingColor"); Properties.angelRingColorMap = FindProperty("_AngelRingColorMap"); Properties.angelRingIntensity = FindProperty("_AngelRingIntensity"); Properties.angelRingOffsetU = FindProperty("_AngelRingOffsetU"); Properties.angelRingOffsetV = FindProperty("_AngelRingOffsetV"); } 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); } } }