Пример #1
0
 public Node(Vector2 position, Vector2 dimensions, NodeStyleInfo styleInfo,
             Action <ConnectionPointBase> onClickInPoint, Action <ConnectionPointBase> onClickOutPoint,
             Action <Node> onClickRemoveNode, string inPointId = null, string outPointId = null)
 {
     rect         = new Rect(position.x, position.y, dimensions.x, dimensions.y);
     inPoint      = new NodeConnectionPoint(this, ConnectionPointType.In, styleInfo.inPointStyle, onClickInPoint, inPointId);
     outPoint     = new NodeConnectionPoint(this, ConnectionPointType.Out, styleInfo.outPointStyle, onClickOutPoint, outPointId);
     OnRemoveNode = onClickRemoveNode;
 }
Пример #2
0
        protected void OnClickOutPoint(ConnectionPointBase outPoint)
        {
            selectedOutPoint = outPoint as NodeConnectionPoint;

            if (selectedInPoint != null)
            {
                if (selectedOutPoint.node != selectedInPoint.node)
                {
                    CreateConnection();
                }
                ClearConnectionSelection();
            }
        }
Пример #3
0
 public Connection(NodeConnectionPoint inPoint, NodeConnectionPoint outPoint, Action <Connection> onClickRemoveConnection)
 {
     this.inPoint  = inPoint;
     this.outPoint = outPoint;
     this.OnClickRemoveConnection = onClickRemoveConnection;
 }
Пример #4
0
 protected void ClearConnectionSelection()
 {
     selectedInPoint  = null;
     selectedOutPoint = null;
 }