UnityEditor.OcclusionCullingWindow.ShowModePopup C# (CSharp) Method

ShowModePopup() private method

private ShowModePopup ( Rect popupRect ) : bool
popupRect UnityEngine.Rect
return bool
        private bool ShowModePopup(Rect popupRect)
        {
            int umbraDataSize = StaticOcclusionCulling.umbraDataSize;
            if (this.m_PreVis != StaticOcclusionCullingVisualization.showPreVisualization)
            {
                SceneView.RepaintAll();
            }
            if (Event.current.type == EventType.Layout)
            {
                this.m_PreVis = StaticOcclusionCullingVisualization.showPreVisualization;
            }
            string[] strArray = new string[] { "Edit", "Visualize" };
            int index = !this.m_PreVis ? 1 : 0;
            if (EditorGUI.ButtonMouseDown(popupRect, new GUIContent(strArray[index]), FocusType.Passive, EditorStyles.popup))
            {
                GenericMenu menu = new GenericMenu();
                menu.AddItem(new GUIContent(strArray[0]), index == 0, new GenericMenu.MenuFunction(this.SetShowVolumePreVis));
                if (umbraDataSize > 0)
                {
                    menu.AddItem(new GUIContent(strArray[1]), index == 1, new GenericMenu.MenuFunction(this.SetShowVolumeCulling));
                }
                else
                {
                    menu.AddDisabledItem(new GUIContent(strArray[1]));
                }
                menu.Popup(popupRect, index);
            }
            return this.m_PreVis;
        }