public void OnAddGrid() { GridRows = EditorGUILayout.IntField("Number of Rows: ", GridRows); GridColumns = EditorGUILayout.IntField("Number of Nodes Per Row: ", GridColumns); GridOffset = EditorGUILayout.IntSlider("Node Offset", GridOffset, 1, 10); List <Node> gridNodes = new List <Node>(); if (GUILayout.Button("Add Grid")) { gridNodes = map.AddNodeGrid(GridColumns, GridRows, map.transform.position, GridOffset); } map.UpdateEdges(gridNodes, true); }