56 lines
2.6 KiB
C#
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");
|
|
|
|
public 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);
|
|
}
|
|
}
|
|
}
|