public void UnLink(AbstractSocket socket) { if (socket == null || !socket.IsConnected()) { return; } if (socket.IsInput()) { InputSocket inputSocket = (InputSocket)socket; if (inputSocket.Edge != null) { UnLink(inputSocket, inputSocket.Edge.Output); } } if (socket.IsOutput()) { OutputSocket outputSocket = (OutputSocket)socket; Edge[] edgeCopy = new Edge[outputSocket.Edges.Count]; outputSocket.Edges.CopyTo(edgeCopy); foreach (var edge in edgeCopy) { UnLink(edge.Input, outputSocket); } } }
public static Vector2 GetEdgePosition(AbstractSocket socket, Vector2 position) { if (socket.Parent.Collapsed) { float width = BonConfig.SocketSize; if (socket.IsOutput()) { width = 0; } position.Set(socket.X + width, socket.Parent.WindowRect.y + 8); } else { float width = 0; if (socket.IsOutput()) { width = BonConfig.SocketSize; } position.Set(socket.X + width, socket.Y + BonConfig.SocketSize / 2f); } return(position); }