private static void BakeButtons() { GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.FlexibleSpace(); bool enabled = GUI.enabled; GUI.enabled &= !Application.isPlaying; GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.Width(95f) }; if (GUILayout.Button("Clear", options)) { NavMeshBuilder.ClearAllNavMeshes(); } GUI.enabled = enabled; if (NavMeshBuilder.isRunning) { GUILayoutOption[] optionArray2 = new GUILayoutOption[] { GUILayout.Width(95f) }; if (GUILayout.Button("Cancel", optionArray2)) { NavMeshBuilder.Cancel(); } } else { enabled = GUI.enabled; GUI.enabled &= !Application.isPlaying; GUILayoutOption[] optionArray3 = new GUILayoutOption[] { GUILayout.Width(95f) }; if (GUILayout.Button("Bake", optionArray3)) { NavMeshBuilder.BuildNavMeshAsync(); } GUI.enabled = enabled; } GUILayout.EndHorizontal(); EditorGUILayout.Space(); }
private static void BakeButtons() { GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); bool enabled1 = GUI.enabled; GUI.enabled &= !Application.isPlaying; if (GUILayout.Button("Clear", new GUILayoutOption[1] { GUILayout.Width(95f) })) { NavMeshBuilder.ClearAllNavMeshes(); } GUI.enabled = enabled1; if (NavMeshBuilder.isRunning) { if (GUILayout.Button("Cancel", new GUILayoutOption[1] { GUILayout.Width(95f) })) { NavMeshBuilder.Cancel(); } } else { bool enabled2 = GUI.enabled; GUI.enabled &= !Application.isPlaying; if (GUILayout.Button("Bake", new GUILayoutOption[1] { GUILayout.Width(95f) })) { NavMeshBuilder.BuildNavMeshAsync(); } GUI.enabled = enabled2; } GUILayout.EndHorizontal(); EditorGUILayout.Space(); }