public void AddNode(FunctionGraphEditorNode node) { nodes.Add(node.GraphNode, node); nodesList.Add(node); node.OnInConnectionPointClicked += OnInConnectionPointClicked; node.OnOutConnectionPointClicked += OnOutConnectionPointClicked; }
public ConnectionToDraw(FunctionGraphEditorNode fromNode, FunctionGraphEditorNode toNode, ConnectionPoint fromPoint, ConnectionPoint toPoint, int editorNodeConnectionPointIndex) { this.fromNode = fromNode ?? throw new ArgumentNullException(nameof(fromNode)); this.toNode = toNode ?? throw new ArgumentNullException(nameof(toNode)); this.fromPoint = fromPoint ?? throw new ArgumentNullException(nameof(fromPoint)); this.toPoint = toPoint ?? throw new ArgumentNullException(nameof(toPoint)); EditorNodeConnectionPointIndex = editorNodeConnectionPointIndex; }
public void CreateConnection(FunctionGraphEditorNode to, int idx, ConnectionPoint fromPoint, ConnectionPoint toPoint) { // set parent GraphNode.ParentTo(to.GraphNode, idx); //create con ToDraw CreateConnectionDrawable(to, fromPoint, toPoint); }
public ConnectionPoint(ConnectionPointType pointType, int idx, FunctionGraphEditorNode nodeBelongingTo, Rect offsetRect, GUIStyle style, Action <ConnectionPoint, int> onConnectionPointClick, string label = "") { PointType = pointType; this.idx = idx; this.OffsetRect = offsetRect; this.label = label; this.nodeBelongingTo = nodeBelongingTo ?? throw new ArgumentNullException(nameof(nodeBelongingTo)); OnConnectionPointClick = onConnectionPointClick ?? throw new ArgumentNullException(nameof(onConnectionPointClick)); this.style = style; }
private void CreateConnectionDrawable(FunctionGraphEditorNode to, ConnectionPoint fromPoint, ConnectionPoint toPoint) { conToDraw = new ConnectionToDraw(this, to, fromPoint, toPoint, to.connectionPoints.IndexOf(toPoint)); }
public void SetOutNode(FunctionGraphEditorNode node, ConnectionPoint p, int nodeChildIndx) { outNode = new ClickedNodeInfo(node, p, nodeChildIndx); TryCreateConnection(); }
public ClickedNodeInfo(FunctionGraphEditorNode node, ConnectionPoint conPoint, int nodeChildIdx) { EditorNode = node ?? throw new ArgumentNullException(nameof(node)); ConPoint = conPoint ?? throw new ArgumentNullException(nameof(conPoint)); NodeChildIdx = nodeChildIdx; }
public NodeNeedingParenting(FunctionGraphEditorNodeSerializable data, FunctionGraphEditorNode node) { this.Data = data; this.Node = node ?? throw new ArgumentNullException(nameof(node)); }
public int GetIndex(FunctionGraphEditorNode n) { return(nodesList.IndexOf(n)); }
public void OnInConnectionPointClicked(FunctionGraphEditorNode node, ConnectionPoint point, int nodeChildIdx) { //TODO clickedNodeTraker.SetInNode(node, point, nodeChildIdx); }
public void OnOutConnectionPointClicked(FunctionGraphEditorNode node, ConnectionPoint point, int nodeChildIdx) { clickedNodeTraker.SetOutNode(node, point, nodeChildIdx); }
public void RemoveNode(FunctionGraphEditorNode functionGraphEditorNode) { nodes.Remove(functionGraphEditorNode.GraphNode); nodesList.Remove(functionGraphEditorNode); isValidGraph = false; }
public void UnsetNodeBelongingTo() { nodeBelongingTo = null; }