mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-20 17:26:02 +08:00
Added editor onUpdateNode callback on Connect/Disconnect
This commit is contained in:
parent
d3a057b9af
commit
ac4fb1efd9
@ -68,10 +68,12 @@ public partial class NodeEditorWindow {
|
|||||||
} else {
|
} else {
|
||||||
hoveredPort.VerifyConnections();
|
hoveredPort.VerifyConnections();
|
||||||
if (hoveredPort.IsConnected) {
|
if (hoveredPort.IsConnected) {
|
||||||
|
Node node = hoveredPort.node;
|
||||||
NodePort output = hoveredPort.Connection;
|
NodePort output = hoveredPort.Connection;
|
||||||
hoveredPort.Disconnect(output);
|
hoveredPort.Disconnect(output);
|
||||||
draggedOutput = output;
|
draggedOutput = output;
|
||||||
draggedOutputTarget = hoveredPort;
|
draggedOutputTarget = hoveredPort;
|
||||||
|
NodeEditor.onUpdateNode(node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (IsHoveringNode && IsHoveringTitle(hoveredNode)) {
|
} else if (IsHoveringNode && IsHoveringTitle(hoveredNode)) {
|
||||||
@ -85,7 +87,9 @@ public partial class NodeEditorWindow {
|
|||||||
if (IsDraggingPort) {
|
if (IsDraggingPort) {
|
||||||
//If connection is valid, save it
|
//If connection is valid, save it
|
||||||
if (draggedOutputTarget != null) {
|
if (draggedOutputTarget != null) {
|
||||||
|
Node node = draggedOutputTarget.node;
|
||||||
if (graph.nodes.Count != 0) draggedOutput.Connect(draggedOutputTarget);
|
if (graph.nodes.Count != 0) draggedOutput.Connect(draggedOutputTarget);
|
||||||
|
NodeEditor.onUpdateNode(node);
|
||||||
EditorUtility.SetDirty(graph);
|
EditorUtility.SetDirty(graph);
|
||||||
}
|
}
|
||||||
//Release dragged connection
|
//Release dragged connection
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user