mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-20 09:16:01 +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 {
|
||||
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user