void RegenerateNodes() { nodes.ResetNodes(false); for (var x = 0; x < 30;) { var point = new Vector2(Random.Range(-10f, 10f), Random.Range(-10f, 10f)); if (NodeGenerator.CheckNodePosition(point, nodes.NodeList)) { nodes.AddNode(point); x++; } } }