Cancel() private method

private Cancel ( ) : void
return void
コード例 #1
0
        private void BakeButtons()
        {
            float width = 95f;

            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            bool flag = !EditorApplication.isPlayingOrWillChangePlaymode;

            GUI.enabled = StaticOcclusionCulling.umbraDataSize != 0 && flag;
            if (GUILayout.Button("Clear", new GUILayoutOption[1] {
                GUILayout.Width(width)
            }))
            {
                StaticOcclusionCulling.Clear();
            }
            GUI.enabled = flag;
            if (StaticOcclusionCulling.isRunning)
            {
                if (GUILayout.Button("Cancel", new GUILayoutOption[1] {
                    GUILayout.Width(width)
                }))
                {
                    StaticOcclusionCulling.Cancel();
                }
            }
            else if (GUILayout.Button("Bake", new GUILayoutOption[1] {
                GUILayout.Width(width)
            }))
            {
                StaticOcclusionCulling.GenerateInBackground();
            }
            GUILayout.EndHorizontal();
            GUI.enabled = true;
        }
コード例 #2
0
        void BakeButtons()
        {
            float buttonWidth = 95;

            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();

            bool allowBaking = !EditorApplication.isPlayingOrWillChangePlaymode;
            bool bakeRunning = StaticOcclusionCulling.isRunning;

            GUI.enabled = !bakeRunning && allowBaking;
            if (CustomDropdownButton("Clear", buttonWidth))
            {
                if (m_ClearBakeData)
                {
                    StaticOcclusionCulling.Clear();
                }

                if (m_ClearCacheData)
                {
                    StaticOcclusionCulling.RemoveCacheFolder();
                }
            }

            GUI.enabled = allowBaking;
            if (bakeRunning)
            {
                if (GUILayout.Button("Cancel", GUILayout.Width(buttonWidth)))
                {
                    StaticOcclusionCulling.Cancel();
                }
            }
            else
            {
                if (GUILayout.Button("Bake", GUILayout.Width(buttonWidth)))
                {
                    StaticOcclusionCulling.GenerateInBackground();
                }
            }

            GUILayout.EndHorizontal();
            GUI.enabled = true;
        }
コード例 #3
0
        void BakeButtons()
        {
            float buttonWidth = 95;

            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();

            bool allowBaking = !EditorApplication.isPlayingOrWillChangePlaymode;

            // Clear Tome button
            GUI.enabled = StaticOcclusionCulling.umbraDataSize != 0 && allowBaking;
            if (GUILayout.Button("Clear", GUILayout.Width(buttonWidth)))
            {
                StaticOcclusionCulling.Clear();
            }
            GUI.enabled = allowBaking;

            // Is occlusion culling running
            if (StaticOcclusionCulling.isRunning)
            {
                if (GUILayout.Button("Cancel", GUILayout.Width(buttonWidth)))
                {
                    StaticOcclusionCulling.Cancel();
                }
            }
            else
            {
                if (GUILayout.Button("Bake", GUILayout.Width(buttonWidth)))
                {
                    StaticOcclusionCulling.GenerateInBackground();
                }
            }

            GUILayout.EndHorizontal();

            GUI.enabled = true;
        }