public NEConnectionPoint(NENode node, ConnectionPointType type, GUIStyle style, Action <NEConnectionPoint> OnClickConnectionPoint)
 {
     this.node  = node;
     this.type  = type;
     this.style = style;
     this.OnClickConnectionPoint = OnClickConnectionPoint;
     rect = new Rect(0, 0, 10f, 20f);
 }
Example #2
0
        private void OnClickRemoveNode(NENode node)
        {
            if (connections != null)
            {
                List <NEConnection> connectionsToRemove = new List <NEConnection>();

                for (int i = 0; i < connections.Count; i++)
                {
                    if (connections[i].inPoint == node.inPoint || connections[i].outPoint == node.outPoint)
                    {
                        connectionsToRemove.Add(connections[i]);
                    }
                }

                for (int i = 0; i < connectionsToRemove.Count; i++)
                {
                    connections.Remove(connectionsToRemove[i]);
                }

                connectionsToRemove = null;
            }

            nodes.Remove(node);
        }