diff options
| author | yum <yum.food.vr@gmail.com> | 2025-01-01 17:42:11 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-01-01 17:42:11 -0800 |
| commit | df8aa8f2b59bad2269f9228d5ed25e7454ca3971 (patch) | |
| tree | 9ae33b187458a2c5e5245c65208aad68a526ee4b /Editor/tooner.cs | |
| parent | 4880e4125f529496a48269eda545ca006db17646 (diff) | |
More work on downstairs 2 gimmicks
* Use float param to select which gimmick to show
* Add colors & domain warping to gimmick 2
* Also optimize it. Colors let us avoid 4-fold neighbor check fanout
* Add rough/unoptimized version of gimmick 3
Diffstat (limited to 'Editor/tooner.cs')
| -rw-r--r-- | Editor/tooner.cs | 69 |
1 files changed, 38 insertions, 31 deletions
diff --git a/Editor/tooner.cs b/Editor/tooner.cs index 118c0fa..0d59420 100644 --- a/Editor/tooner.cs +++ b/Editor/tooner.cs @@ -1827,14 +1827,17 @@ public class ToonerGUI : ShaderGUI { bc = FindProperty("_Gimmick_DS2_Emission_Factor"); FloatProperty(bc, "Emission factor"); - bc = FindProperty("_Gimmick_DS2_00_Enable_Dynamic"); - enabled = (bc.floatValue != 0.0); - EditorGUI.BeginChangeCheck(); - enabled = Toggle("Enable effect 00", enabled); - EditorGUI.EndChangeCheck(); - bc.floatValue = enabled ? 1.0f : 0.0f; + bc = FindProperty("_Gimmick_DS2_Choice"); + FloatProperty(bc, "Choice"); + float choice = bc.floatValue; - if (enabled) { + if (Mathf.Round(choice) == -1) { + EditorGUI.indentLevel += 1; + + EditorGUI.indentLevel -= 1; + } + + if (Mathf.Round(choice) == 0) { EditorGUI.indentLevel += 1; bc = FindProperty("_Gimmick_DS2_00_Domain_Warping_Octaves"); @@ -1849,14 +1852,7 @@ public class ToonerGUI : ShaderGUI { EditorGUI.indentLevel -= 1; } - bc = FindProperty("_Gimmick_DS2_01_Enable_Dynamic"); - enabled = (bc.floatValue != 0.0); - EditorGUI.BeginChangeCheck(); - enabled = Toggle("Enable effect 01", enabled); - EditorGUI.EndChangeCheck(); - bc.floatValue = enabled ? 1.0f : 0.0f; - - if (enabled) { + if (Mathf.Round(choice) == 1) { EditorGUI.indentLevel += 1; bc = FindProperty("_Gimmick_DS2_01_Period"); @@ -1878,27 +1874,29 @@ public class ToonerGUI : ShaderGUI { EditorGUI.indentLevel -= 1; } - bc = FindProperty("_Gimmick_DS2_02_Enable_Dynamic"); - enabled = (bc.floatValue != 0.0); - EditorGUI.BeginChangeCheck(); - enabled = Toggle("Enable effect 02", enabled); - EditorGUI.EndChangeCheck(); - bc.floatValue = enabled ? 1.0f : 0.0f; - - if (enabled) { + if (Mathf.Round(choice) == 2) { EditorGUI.indentLevel += 1; + bc = FindProperty("_Gimmick_DS2_02_Period"); + VectorProperty(bc, "Period"); + bc = FindProperty("_Gimmick_DS2_02_Count"); + VectorProperty(bc, "Count"); + bc = FindProperty("_Gimmick_DS2_02_Edge_Length"); + FloatProperty(bc, "Edge length"); + + bc = FindProperty("_Gimmick_DS2_02_Domain_Warping_Octaves"); + FloatProperty(bc, "Domain warping octaves"); + bc = FindProperty("_Gimmick_DS2_02_Domain_Warping_Strength"); + FloatProperty(bc, "Domain warping strength"); + bc = FindProperty("_Gimmick_DS2_02_Domain_Warping_Scale"); + FloatProperty(bc, "Domain warping scale"); + bc = FindProperty("_Gimmick_DS2_02_Domain_Warping_Speed"); + FloatProperty(bc, "Domain warping speed"); + EditorGUI.indentLevel -= 1; } - bc = FindProperty("_Gimmick_DS2_03_Enable_Dynamic"); - enabled = (bc.floatValue != 0.0); - EditorGUI.BeginChangeCheck(); - enabled = Toggle("Enable effect 03", enabled); - EditorGUI.EndChangeCheck(); - bc.floatValue = enabled ? 1.0f : 0.0f; - - if (enabled) { + if (Mathf.Round(choice) == 3) { EditorGUI.indentLevel += 1; bc = FindProperty("_Gimmick_DS2_03_Period"); @@ -1908,6 +1906,15 @@ public class ToonerGUI : ShaderGUI { bc = FindProperty("_Gimmick_DS2_03_Edge_Length"); FloatProperty(bc, "Edge length"); + bc = FindProperty("_Gimmick_DS2_03_Domain_Warping_Octaves"); + FloatProperty(bc, "Domain warping octaves"); + bc = FindProperty("_Gimmick_DS2_03_Domain_Warping_Strength"); + FloatProperty(bc, "Domain warping strength"); + bc = FindProperty("_Gimmick_DS2_03_Domain_Warping_Scale"); + FloatProperty(bc, "Domain warping scale"); + bc = FindProperty("_Gimmick_DS2_03_Domain_Warping_Speed"); + FloatProperty(bc, "Domain warping speed"); + EditorGUI.indentLevel -= 1; } |
