diff --git a/Editor/ShaderDrawer.cs b/Editor/ShaderDrawer.cs index 75a4803..5f2012e 100644 --- a/Editor/ShaderDrawer.cs +++ b/Editor/ShaderDrawer.cs @@ -1329,7 +1329,7 @@ public PassSwitchDecorator(string lightModeName1, string lightModeName2, string public PassSwitchDecorator(string lightModeName1, string lightModeName2, string lightModeName3, string lightModeName4, string lightModeName5, string lightModeName6) : this(new[] { lightModeName1, lightModeName2, lightModeName3, lightModeName4, lightModeName5, lightModeName6 }) { } - public PassSwitchDecorator(string[] passNames) { _lightModeNames = passNames.Select((s => s.ToUpper())).ToArray(); } + public PassSwitchDecorator(string[] lightModeNames) { _lightModeNames = lightModeNames.Select((s => s.ToUpper())).ToArray(); } #endregion diff --git a/UnityEditorExtension/LwguiGradientEditor/LwguiGradientEditor.cs b/UnityEditorExtension/LwguiGradientEditor/LwguiGradientEditor.cs index 0cf7630..6c8a414 100644 --- a/UnityEditorExtension/LwguiGradientEditor/LwguiGradientEditor.cs +++ b/UnityEditorExtension/LwguiGradientEditor/LwguiGradientEditor.cs @@ -134,6 +134,7 @@ private static bool Equal(GradientEditor.Swatch a, GradientEditor.Swatch b) => private GradientEditor _gradientEditor; private CurveEditor _curveEditor; private bool _viewSettingschanged; + private bool _curveEditorContextMenuChanged; private bool _changed; private bool _lastChanged; @@ -689,7 +690,7 @@ private void InitCurveEditor(bool force = false) } _curveEditor.animationCurves = cws; - _curveEditor.curvesUpdated = null; + _curveEditor.curvesUpdated = () => _curveEditorContextMenuChanged = true; SyncCurveEditorRect(); @@ -708,10 +709,11 @@ private void OnCurveEditorGUI() PrepareSyncSelectionFromCurveToGradient(); EditorGUI.BeginChangeCheck(); _curveEditor.OnGUI(); - if (EditorGUI.EndChangeCheck()) + _changed |= EditorGUI.EndChangeCheck() || _curveEditorContextMenuChanged; + if (_changed) { - _changed = true; - InitGradientEditor(true); + InitGradientEditor(true); + _curveEditorContextMenuChanged = false; } SyncSelectionFromCurveToGradient(); } diff --git a/package.json b/package.json index dc9da2e..eab7deb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.jasonma.lwgui", - "version": "1.19.0", + "version": "1.19.1", "displayName": "LWGUI", "description": "A Lightweight, Flexible, Powerful Shader GUI System for Unity.", "keywords": [