Skip to content

Commit

Permalink
Merge pull request #65 from JasonMa0012/2.x
Browse files Browse the repository at this point in the history
Fix Context Menu Event in Ramp Editor
  • Loading branch information
JasonMa0012 authored Oct 18, 2024
2 parents dcb0ad7 + c318d32 commit 2c91e3f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Editor/ShaderDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 6 additions & 4 deletions UnityEditorExtension/LwguiGradientEditor/LwguiGradientEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -689,7 +690,7 @@ private void InitCurveEditor(bool force = false)
}

_curveEditor.animationCurves = cws;
_curveEditor.curvesUpdated = null;
_curveEditor.curvesUpdated = () => _curveEditorContextMenuChanged = true;

SyncCurveEditorRect();

Expand All @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down

0 comments on commit 2c91e3f

Please sign in to comment.