Exemple #1
0
 private void mouseClick()
 {
     if (Event.current.type == EventType.mouseUp && Event.current.modifiers != EventModifiers.Shift)
     {
         {
             link = null;
             if (connection != null)
             {
                 connection.Break();
                 connection = null;
             }
         }
     }
 }
Exemple #2
0
 // creates a list of links for the connections in use
 public void SetupLinks(ArrayList links)
 {
     foreach (CConnection c in Outputs)
     {
         if (c.pointer != null)
         {
             CLink l = new CLink();
             l.from = c;
             l.to   = c.pointer;
             links.Add(l);
         }
     }
     foreach (CConnection c in Bottoms)
     {
         if (c.pointer != null)
         {
             CLink l = new CLink();
             l.from     = c;
             l.to       = c.pointer;
             l.drawType = 1;
             links.Add(l);
         }
     }
 }
Exemple #3
0
        public CConnection Click(CConnection c)
        {
            // First, what if completely blank: Create new link

            if (c == null && pointer == null)
            {
                c = this;
                CLink l = new CLink();
                l.from = c;
                l.to   = null;
                //Debug.Log ("Created new link from empty");
                CNodeManager.link = l;
                //PropagateChange();
                return(c);
            }
            // Attatch existing string to connection
            if (c != null && pointer == null)
            {
                // is this valid?
                if (!verifyConnection(c))
                {
                    return(c);
                }

                Link(c);
//								PropagateChange();

                //Debug.Log ("Attatched link to empty");
                CNodeManager.link = null;

                return(null);
            }

            // if clicked on existing link
            if (c == null && pointer != null)
            {
                c = pointer;
                CLink l = new CLink();
                l.from = c;
                l.to   = null;
                //Debug.Log ("Created new link from existing");
                CNodeManager.link = l;
                //PropagateChange();

                Break();
                return(c);
            }

            // SWAP!
            if (c != null && pointer != null)
            {
                if (!verifyConnection(c))
                {
                    return(c);
                }
                // Basically: Swap connections
                CConnection old = pointer;
                old.Break();
                //Break();
                Link(c);
                CLink l = new CLink();
                l.from            = old;
                l.to              = null;
                CNodeManager.link = l;
//								PropagateChange();


                return(old);
            }

            CNodeManager.link = null;
            return(null);
        }