Hide enum/structure nodes from state machine surface context menu

This commit is contained in:
Wojciech Figat
2021-12-03 15:35:23 +01:00
parent 3e2956a7bf
commit e17b6d1625

View File

@@ -360,13 +360,21 @@ namespace FlaxEditor.Surface
/// <inheritdoc />
protected override void OnShowPrimaryMenu(VisjectCM activeCM, Vector2 location, Box startBox)
{
Profiler.BeginEvent("Setup Anim Graph Context Menu");
NodesCache.Get(activeCM);
Profiler.EndEvent();
// Check if show additional nodes in the current surface context
if (activeCM != _cmStateMachineMenu)
{
Profiler.BeginEvent("Setup Anim Graph Context Menu");
NodesCache.Get(activeCM);
Profiler.EndEvent();
base.OnShowPrimaryMenu(activeCM, location, startBox);
base.OnShowPrimaryMenu(activeCM, location, startBox);
activeCM.VisibleChanged += OnActiveContextMenuVisibleChanged;
activeCM.VisibleChanged += OnActiveContextMenuVisibleChanged;
}
else
{
base.OnShowPrimaryMenu(activeCM, location, startBox);
}
}
private void OnActiveContextMenuVisibleChanged(Control activeCM)