Exemplo n.º 1
0
        private void DrawConnectionCurve(NodeConnection c) {
            Rect r1;
            Rect r2;

            if(c.GetFromHandle() != null) {
                r1 = c.GetFromHandle().rect;
            } else {
                r1 = c.GetFromNode().rect;
            }

            if(c.GetToHandle() != null) {
                r2 = c.GetToHandle().rect;
            } else {
                r2 = c.GetToNode().rect;
            }

            NodeUtils.DrawNodeCurve(r1, r2);
        }
Exemplo n.º 2
0
 public virtual NodeConnection ConnectNodes(BaseNode from, BaseNode to) {
     if (from == null ||
         to == null)
         return null;
     NodeConnection c = new NodeConnection(from, to);
     from.AddConnection(c);
     to.AddConnection(c);
     return c;
 }
Exemplo n.º 3
0
 public void RemoveConnection(NodeConnection connection) {
     if (!connections.Contains(connection)) return;
     connections.Remove(connection);
 }
Exemplo n.º 4
0
 public void AddConnection(NodeConnection connection) {
     if (connections.Contains(connection)) return;
     connections.Add(connection);
 }