public void OnGUI() { NodeWindow = GUILayout.Window(WindowID, NodeWindow, DrawNode, ""); //Draw the connections foreach (NodeConnection connection in nodeConnections.Where(x => x != null)) { if (connection.Destination != null) { NodeConnection.DrawConnected(connection.Source, connection.Destination.NodeWindow, NodeWindow); } else { NodeConnection.DrawConnected(connection.Source, new Rect(Event.current.mousePosition.x, Event.current.mousePosition.y, 1, 1), NodeWindow); } } }
public NodeConnection(SerializableRect from, Node to) { Source = from; Destination = to; }