Esempio n. 1
0
 public void AddNode(FunctionGraphEditorNode node)
 {
     nodes.Add(node.GraphNode, node);
     nodesList.Add(node);
     node.OnInConnectionPointClicked  += OnInConnectionPointClicked;
     node.OnOutConnectionPointClicked += OnOutConnectionPointClicked;
 }
Esempio n. 2
0
 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);
    }
Esempio n. 4
0
    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;
 }
Esempio n. 8
0
 public NodeNeedingParenting(FunctionGraphEditorNodeSerializable data, FunctionGraphEditorNode node)
 {
     this.Data = data;
     this.Node = node ?? throw new ArgumentNullException(nameof(node));
 }
Esempio n. 9
0
 public int GetIndex(FunctionGraphEditorNode n)
 {
     return(nodesList.IndexOf(n));
 }
Esempio n. 10
0
    public void OnInConnectionPointClicked(FunctionGraphEditorNode node, ConnectionPoint point, int nodeChildIdx)
    {
        //TODO

        clickedNodeTraker.SetInNode(node, point, nodeChildIdx);
    }
Esempio n. 11
0
 public void OnOutConnectionPointClicked(FunctionGraphEditorNode node, ConnectionPoint point, int nodeChildIdx)
 {
     clickedNodeTraker.SetOutNode(node, point, nodeChildIdx);
 }
Esempio n. 12
0
 public void RemoveNode(FunctionGraphEditorNode functionGraphEditorNode)
 {
     nodes.Remove(functionGraphEditorNode.GraphNode);
     nodesList.Remove(functionGraphEditorNode);
     isValidGraph = false;
 }
Esempio n. 13
0
 public void UnsetNodeBelongingTo()
 {
     nodeBelongingTo = null;
 }