public ConnectionPoint(NeuronNode node, ConnectionPointType type, GUIStyle style, Action <ConnectionPoint> OnClickConnectionPoint) { this.neuron = node; this.type = type; this.style = style; this.onClickConnectionPoint = OnClickConnectionPoint; rect = new Rect(0, 0, 10, 10); }
private void OnClickRemoveNode(NeuronNode node) { if (connections != null) { List <Connection> connectionToRemove = new List <Connection>(); for (int i = 0; i < connections.Count; i++) { if (connections[i].InPoint == node.InPoint || connections[i].OutPoint == node.OutPoint) { connectionToRemove.Add(connections[i]); } } for (int i = 0; i < connectionToRemove.Count; i++) { connections.Remove(connectionToRemove[i]); } connectionToRemove = null; } nodes.Remove(node); }