From 7875e0a656a4bc8802ce7365baa34be3be20dac4 Mon Sep 17 00:00:00 2001 From: yum Date: Fri, 13 Sep 2024 14:05:27 -0700 Subject: Convert mochie params to range/toggle --- Editor/tooner.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'Editor') diff --git a/Editor/tooner.cs b/Editor/tooner.cs index 8cfbecb..9c07691 100644 --- a/Editor/tooner.cs +++ b/Editor/tooner.cs @@ -1689,15 +1689,21 @@ public class ToonerGUI : ShaderGUI { MaterialProperty bc; bc = FindProperty("_WrappingFactor"); - editor.FloatProperty(bc, "Wrapping factor"); + editor.RangeProperty(bc, "Wrapping factor"); bc = FindProperty("_SpecularStrength"); - editor.FloatProperty(bc, "Specular strength"); + editor.RangeProperty(bc, "Specular strength"); bc = FindProperty("_FresnelStrength"); - editor.FloatProperty(bc, "Fresnel strength"); + editor.RangeProperty(bc, "Fresnel strength"); + bc = FindProperty("_UseFresnel"); - editor.FloatProperty(bc, "Use fresnel"); + bool enabled = bc.floatValue > 1E-6; + EditorGUI.BeginChangeCheck(); + enabled = EditorGUILayout.Toggle("Use fresnel", enabled); + EditorGUI.EndChangeCheck(); + bc.floatValue = enabled ? 1.0f : 0.0f; + bc = FindProperty("_ReflectionStrength"); - editor.FloatProperty(bc, "Reflection strength"); + editor.RangeProperty(bc, "Reflection strength"); EditorGUI.indentLevel -= 1; } -- cgit v1.2.3