Skip to content

Commit

Permalink
Merge pull request #66 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 2c91e3f + 0ab60b4 commit 0dd38df
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions UnityEditorExtension/LwguiGradientEditor/LwguiGradientEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,11 @@ private void InitCurveEditor(bool force = false)
}

_curveEditor.animationCurves = cws;
_curveEditor.curvesUpdated = () => _curveEditorContextMenuChanged = true;
_curveEditor.curvesUpdated = () =>
{
_curveEditorContextMenuChanged = true;
Debug.Log(111111111);
};

SyncCurveEditorRect();

Expand All @@ -709,10 +713,15 @@ private void OnCurveEditorGUI()
PrepareSyncSelectionFromCurveToGradient();
EditorGUI.BeginChangeCheck();
_curveEditor.OnGUI();
_changed |= EditorGUI.EndChangeCheck() || _curveEditorContextMenuChanged;
if (_changed)
bool curveEditorChanged = EditorGUI.EndChangeCheck() || _curveEditorContextMenuChanged;
_changed |= curveEditorChanged;
if (curveEditorChanged)
{
InitGradientEditor(true);
foreach (var cw in _curveEditor.animationCurves)
{
cw.changed = false;
}
_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.1",
"version": "1.19.2",
"displayName": "LWGUI",
"description": "A Lightweight, Flexible, Powerful Shader GUI System for Unity.",
"keywords": [
Expand Down

0 comments on commit 0dd38df

Please sign in to comment.