public override void OnInspectorGUI() { DrawDefaultInspector(); EditorGUILayout.LabelField("Опции"); MazeGenParallel maze_gen = (MazeGenParallel)target; if (GUILayout.Button("ReGenerate Maze Parallel")) { int n = maze_gen.transform.childCount; for (int i = 0; i < n; i++) { SafeDestroy.SafeDestroyGameObject(maze_gen.transform.GetChild(0)); } maze_gen.RegenerateMaze(); } if (GUILayout.Button("ReGenerate Maze")) { MazeGen maze_gen1 = GameObject.Find("Plane").GetComponent <MazeGen>(); int n = maze_gen1.transform.childCount; for (int i = 0; i < n; i++) { SafeDestroy.SafeDestroyGameObject(maze_gen1.transform.GetChild(0)); } maze_gen1.RegenerateMaze(); } EditorGUI.BeginChangeCheck(); this._selected = EditorGUILayout.Popup("My Simple Dropdown", _selected, _options); if (EditorGUI.EndChangeCheck()) { Debug.Log(_options[_selected]); } }
public void DeleteWaypoints() { int i = 0; while (wps.Count != 2) { Component wp = wps[i]; if (wp.name != "S" && wp.name != "E") { SafeDestroy.SafeDestroyGameObject(wp); i--; } wps.Remove(wp); i++; } }