From 5c3223949546fee336ba50e5e33736b83c450d78 Mon Sep 17 00:00:00 2001 From: yum Date: Wed, 21 Aug 2024 15:05:32 -0700 Subject: Matcap masks are now UV channel aware --- Editor/tooner.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Editor') diff --git a/Editor/tooner.cs b/Editor/tooner.cs index d769a02..8cb4d07 100644 --- a/Editor/tooner.cs +++ b/Editor/tooner.cs @@ -440,12 +440,19 @@ public class ToonerGUI : ShaderGUI { bool enabled; // c# is a shitty language if (bc.textureValue) { + EditorGUI.indentLevel += 1; bc = FindProperty($"_Matcap{i}_Mask_Invert"); enabled = bc.floatValue > 1E-6; EditorGUI.BeginChangeCheck(); enabled = EditorGUILayout.Toggle("Invert mask", enabled); EditorGUI.EndChangeCheck(); bc.floatValue = enabled ? 1.0f : 0.0f; + + bc = FindProperty($"_Matcap{i}_Mask_UV_Select"); + editor.RangeProperty( + bc, + "UV channel"); + EditorGUI.indentLevel -= 1; } bc = FindProperty($"_Matcap{i}_Mask2"); @@ -455,12 +462,19 @@ public class ToonerGUI : ShaderGUI { SetKeyword($"_MATCAP{i}_MASK2", bc.textureValue); if (bc.textureValue) { + EditorGUI.indentLevel += 1; bc = FindProperty($"_Matcap{i}_Mask2_Invert"); enabled = bc.floatValue > 1E-6; EditorGUI.BeginChangeCheck(); enabled = EditorGUILayout.Toggle("Invert mask", enabled); EditorGUI.EndChangeCheck(); bc.floatValue = enabled ? 1.0f : 0.0f; + + bc = FindProperty($"_Matcap{i}_Mask2_UV_Select"); + editor.RangeProperty( + bc, + "UV channel"); + EditorGUI.indentLevel -= 1; } EditorGUI.BeginChangeCheck(); -- cgit v1.2.3