Added translaprent support

This commit is contained in:
2025-05-22 22:28:48 +09:00
parent 59b46bce44
commit 5b2eb17148
28 changed files with 357 additions and 214 deletions

View File

@@ -1,8 +1,10 @@
using Misaki.ShaderGUI;
using System.Linq;
using UnityEditor;
using UnityEngine;
using static Misaki.HdrpToon.UtsShaderPropertyName.Outline;
using static Misaki.HdrpToon.UTSPropertyName.Outline;
using static UnityEditor.EditorGUI;
namespace Misaki.HdrpToon.Editor
{
@@ -71,6 +73,14 @@ namespace Misaki.HdrpToon.Editor
if (Properties.outlineState.GetBooleanValue())
{
var isTransparentAny = materials.Any(m => m.GetInteger(UTSPropertyName.SurfaceOptions.SURFACE_TYPE) == 1);
if (isTransparentAny)
{
EditorGUILayout.HelpBox("Outline is not supported in transparent mode.", MessageType.Warning);
}
using var settingScope = new DisabledGroupScope(isTransparentAny);
EditorGUILayout.Space();
editor.TexturePropertySingleLine(Styles.outlineWidthText, Properties.outlineWidthMap, Properties.outlineWidth);
editor.TexturePropertySingleLine(Styles.outlineColorText, Properties.outlineColorMap, Properties.outlineColor);