예제 #1
0
        public void OnClickRemoveNode(NodeGUI node)
        {
            if (connections != null)
            {
                List <Connection> connectionsToRemove = new List <Connection>();

                for (int i = 0; i < connections.Count; i++)
                {
                    if (node.data.points.Contains(connections[i].data.inGUID) ||
                        node.data.points.Contains(connections[i].data.outGUID))
                    {
                        connectionsToRemove.Add(connections[i]);
                    }
                }

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

                connectionsToRemove = null;
            }
            nodes.Remove(node);
            node.RemovePoints();
            NodeGUIUtility.RemoveInstance(node.data);
        }
예제 #2
0
 public void RemovePoints()
 {
     foreach (var p in points)
     {
         NodeGUIUtility.RemoveInstance(p.data);
     }
     points.Clear();
 }
예제 #3
0
        public void OnClickRemoveConnection(Connection connection)
        {
            connections.Remove(connection);
            NodePointData inP  = NodeGUIUtility.GetInstance <NodePointData>(connection.data.inGUID),
                          outP = NodeGUIUtility.GetInstance <NodePointData>(connection.data.outGUID);

            inP.connections.Remove(connection.data.GUID);
            outP.connections.Remove(connection.data.GUID);
            NodeGUIUtility.RemoveInstance(connection.data);
        }