From 259a70d8125a3c7ba3231fcabdcf7983a7e7a853 Mon Sep 17 00:00:00 2001 From: Icarus <1375400884@qq.com> Date: Sun, 8 Dec 2019 22:15:07 +0800 Subject: [PATCH] =?UTF-8?q?!B(Node=20Port)=20=E7=9B=B8=E5=90=8C=E8=8A=82?= =?UTF-8?q?=E7=82=B9,=E7=9B=B8=E5=90=8C=E7=AB=AF=E5=8F=A3=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E4=B8=8D=E6=96=AD=E5=BC=80=E9=93=BE=E6=8E=A5=E5=90=8C?= =?UTF-8?q?=E6=97=B6=E4=B9=9F=E4=B8=8D=E8=BF=9B=E8=A1=8C=E8=BF=9E=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Scripts/NodePort.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Scripts/NodePort.cs b/Scripts/NodePort.cs index b6fadb4..c186810 100644 --- a/Scripts/NodePort.cs +++ b/Scripts/NodePort.cs @@ -231,7 +231,17 @@ namespace XNode { if (IsConnectedTo(port)) { Debug.LogWarning("Port already connected. "); return; } if (direction == port.direction) { Debug.LogWarning("Cannot connect two " + (direction == IO.Input ? "input" : "output") + " connections"); return; } if (port.connectionType == Node.ConnectionType.Override && port.ConnectionCount != 0) { port.ClearConnections(); } - if (connectionType == Node.ConnectionType.Override && ConnectionCount != 0) { ClearConnections(); } + + if (connectionType == Node.ConnectionType.Override && ConnectionCount != 0) + { + var conPort = GetConnection(0); + + if(conPort.node != port.node || conPort != port) + { + ClearConnections(); + } + return; + } connections.Add(new PortConnection(port)); if (port.connections == null) port.connections = new List(); if (!port.IsConnectedTo(this)) port.connections.Add(new PortConnection(this));