diff options
| author | yum <yum.food.vr@gmail.com> | 2024-09-13 14:05:27 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2024-09-13 14:05:27 -0700 |
| commit | 7875e0a656a4bc8802ce7365baa34be3be20dac4 (patch) | |
| tree | f34166e7bfb02eb190a2ca381a150e86e9c679a2 /Editor | |
| parent | 532921487d52418357d00f499d13b23a47644a58 (diff) | |
Convert mochie params to range/toggle
Diffstat (limited to 'Editor')
| -rw-r--r-- | Editor/tooner.cs | 16 |
1 files changed, 11 insertions, 5 deletions
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; } |
