From 0fa9695dc40c688d675615de06ae1e9ed2f91334 Mon Sep 17 00:00:00 2001 From: Thor Brigsted Date: Tue, 26 Dec 2017 00:56:02 +0100 Subject: [PATCH] Refined NodePort.Disconnect --- Scripts/NodePort.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Scripts/NodePort.cs b/Scripts/NodePort.cs index 039ab44..8c9cea6 100644 --- a/Scripts/NodePort.cs +++ b/Scripts/NodePort.cs @@ -206,22 +206,21 @@ namespace XNode { /// Disconnect this port from another port public void Disconnect(NodePort port) { - NodePort from = direction == IO.Input ? port : this; - NodePort to = direction == IO.Input ? this : port; // Remove this ports connection to the other for (int i = connections.Count - 1; i >= 0; i--) { if (connections[i].Port == port) { connections.RemoveAt(i); - node.OnRemoveConnection(this); } } // Remove the other ports connection to this port for (int i = 0; i < port.connections.Count; i++) { if (port.connections[i].Port == this) { port.connections.RemoveAt(i); - port.node.OnRemoveConnection(port); } } + // Trigger OnRemoveConnection + node.OnRemoveConnection(this); + port.node.OnRemoveConnection(port); } public void ClearConnections() {