mirror of
https://github.com/Siccity/xNode.git
synced 2026-03-26 22:49:02 +08:00
!B 端口连接后,没有释放连接线
This commit is contained in:
parent
1691e4ce21
commit
2b21b0ddc6
@ -222,17 +222,13 @@ namespace XNodeEditor {
|
|||||||
MenuPopupWindow menu = new MenuPopupWindow();
|
MenuPopupWindow menu = new MenuPopupWindow();
|
||||||
graphEditor.AddContextMenuItems(menu);
|
graphEditor.AddContextMenuItems(menu);
|
||||||
|
|
||||||
menu.OnCloseA += () =>
|
menu.OnCloseA += _releaseDraggedConnection;
|
||||||
{
|
|
||||||
//Release dragged connection
|
|
||||||
draggedOutput = null;
|
|
||||||
draggedOutputTarget = null;
|
|
||||||
EditorUtility.SetDirty(graph);
|
|
||||||
if (NodeEditorPreferences.GetSettings().autoSave) AssetDatabase.SaveAssets();
|
|
||||||
};
|
|
||||||
|
|
||||||
PopupWindow.Show(new Rect(Event.current.mousePosition, Vector2.zero),menu);
|
PopupWindow.Show(new Rect(Event.current.mousePosition, Vector2.zero),menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_releaseDraggedConnection();
|
||||||
|
|
||||||
} else if (currentActivity == NodeActivity.DragNode) {
|
} else if (currentActivity == NodeActivity.DragNode) {
|
||||||
IEnumerable<XNode.Node> nodes = Selection.objects.Where(x => x is XNode.Node).Select(x => x as XNode.Node);
|
IEnumerable<XNode.Node> nodes = Selection.objects.Where(x => x is XNode.Node).Select(x => x as XNode.Node);
|
||||||
foreach (XNode.Node node in nodes) EditorUtility.SetDirty(node);
|
foreach (XNode.Node node in nodes) EditorUtility.SetDirty(node);
|
||||||
@ -346,6 +342,15 @@ namespace XNodeEditor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void _releaseDraggedConnection()
|
||||||
|
{
|
||||||
|
//Release dragged connection
|
||||||
|
draggedOutput = null;
|
||||||
|
draggedOutputTarget = null;
|
||||||
|
EditorUtility.SetDirty(graph);
|
||||||
|
if (NodeEditorPreferences.GetSettings().autoSave) AssetDatabase.SaveAssets();
|
||||||
|
}
|
||||||
|
|
||||||
private void RecalculateDragOffsets(Event current) {
|
private void RecalculateDragOffsets(Event current) {
|
||||||
dragOffset = new Vector2[Selection.objects.Length + selectedReroutes.Count];
|
dragOffset = new Vector2[Selection.objects.Length + selectedReroutes.Count];
|
||||||
// Selected nodes
|
// Selected nodes
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user