1
0
mirror of https://github.com/Siccity/xNode.git synced 2026-03-26 22:49:02 +08:00

!B(Node Port) 相同节点,相同端口连接不断开链接同时也不进行连接

This commit is contained in:
Icarus 2019-12-08 22:15:07 +08:00
parent eb7c9098e9
commit 259a70d812

View File

@ -231,7 +231,17 @@ namespace XNode {
if (IsConnectedTo(port)) { Debug.LogWarning("Port already connected. "); return; } 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 (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 (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)); connections.Add(new PortConnection(port));
if (port.connections == null) port.connections = new List<PortConnection>(); if (port.connections == null) port.connections = new List<PortConnection>();
if (!port.IsConnectedTo(this)) port.connections.Add(new PortConnection(this)); if (!port.IsConnectedTo(this)) port.connections.Add(new PortConnection(this));