Cancel() private method

private Cancel ( ) : void
return void
Example #1
0
        private static void BakeButtons()
        {
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUILayout.FlexibleSpace();
            bool enabled = GUI.enabled;

            GUI.enabled &= !Application.isPlaying;
            if (GUILayout.Button("Clear", new GUILayoutOption[]
            {
                GUILayout.Width(95f)
            }))
            {
                NavMeshBuilder.ClearAllNavMeshes();
            }
            GUI.enabled = enabled;
            if (NavMeshBuilder.isRunning)
            {
                if (GUILayout.Button("Cancel", new GUILayoutOption[]
                {
                    GUILayout.Width(95f)
                }))
                {
                    NavMeshBuilder.Cancel();
                }
            }
            else
            {
                enabled      = GUI.enabled;
                GUI.enabled &= !Application.isPlaying;
                if (GUILayout.Button("Bake", new GUILayoutOption[]
                {
                    GUILayout.Width(95f)
                }))
                {
                    NavMeshBuilder.BuildNavMeshAsync();
                }
                GUI.enabled = enabled;
            }
            GUILayout.EndHorizontal();
            EditorGUILayout.Space();
        }