private void ProcessMouseUpOverPoint(Event e) { bool isLeftClickUp = e.type == EventType.MouseUp && e.button == 0; if (isLeftClickUp) { if (currentGraph != null && currentGraph.nodes != null && clickedInputNode != null && draggingLinkNode) { foreach (AG_Node node in currentGraph.nodes) { if (node.inputPoints != null) { foreach (AG_NodeLinkPoint point in node.inputPoints) { if (point.clickableRect.Contains(e.mousePosition) && node != clickedInputNode) { if (CanCreateLink(clickedOutputPoint, point)) { AG_NodeLink newLink = new AG_NodeLink(clickedInputNode, clickedOutputPoint, node, point); // currentGraph.AddLink(newLink); clickedOutputPoint.AddLink(newLink); point.AddLink(newLink); } ProcessGenericMouseUp(e); e.Use(); } } } } } } }
public void RemoveLink(AG_NodeLink linkToRemove) { if (links != null) { links.Remove(linkToRemove); } }
public void AddLink(AG_NodeLink linkToAdd) { if (links == null) { links = new List <AG_NodeLink>(); } links.Add(linkToAdd); }