1
0
mirror of https://github.com/Siccity/xNode.git synced 2025-12-21 01:36:03 +08:00

Added editor onUpdateNode callback on Connect/Disconnect

This commit is contained in:
Thor Kramer Brigsted 2017-10-26 12:40:34 +02:00
parent d3a057b9af
commit ac4fb1efd9

View File

@ -68,10 +68,12 @@ public partial class NodeEditorWindow {
} else {
hoveredPort.VerifyConnections();
if (hoveredPort.IsConnected) {
Node node = hoveredPort.node;
NodePort output = hoveredPort.Connection;
hoveredPort.Disconnect(output);
draggedOutput = output;
draggedOutputTarget = hoveredPort;
NodeEditor.onUpdateNode(node);
}
}
} else if (IsHoveringNode && IsHoveringTitle(hoveredNode)) {
@ -85,7 +87,9 @@ public partial class NodeEditorWindow {
if (IsDraggingPort) {
//If connection is valid, save it
if (draggedOutputTarget != null) {
Node node = draggedOutputTarget.node;
if (graph.nodes.Count != 0) draggedOutput.Connect(draggedOutputTarget);
NodeEditor.onUpdateNode(node);
EditorUtility.SetDirty(graph);
}
//Release dragged connection