xNode
xNode copied to clipboard
There seems to be a problem with the source code
First of all, I am a netizen from abroad. Your tool is very convenient. Thank you very much. I found that in NodePort.cs, the code for AddConnections and MoveConnections was compared, and I felt a bit similar. According to the comments, my understanding of the method of MoveConnections is to transfer all of its own connections to the targetPort and clear all of its own. By the way, I'm using version 1.7. It seems consistent within the for loop?
`
/// <summary> Copy all connections pointing to a node and add them to this one </summary>
public void AddConnections(NodePort targetPort) {
int connectionCount = targetPort.ConnectionCount;
for (int i = 0; i < connectionCount; i++) {
PortConnection connection = targetPort.connections[i];
NodePort otherPort = connection.Port;
Connect(otherPort);
}
}
/// <summary> Move all connections pointing to this node, to another node </summary>
public void MoveConnections(NodePort targetPort) {
int connectionCount = connections.Count;
// Add connections to target port
for (int i = 0; i < connectionCount; i++) {
PortConnection connection = targetPort.connections[i];
NodePort otherPort = connection.Port;
Connect(otherPort);
}
ClearConnections();
}
`