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[2] {
"Edit", "Visualize"
};
int selectedIndex = !this.m_PreVis ? 1 : 0;
if (EditorGUI.ButtonMouseDown(popupRect, new GUIContent(strArray[selectedIndex]), FocusType.Passive, EditorStyles.popup))
{
GenericMenu genericMenu = new GenericMenu();
genericMenu.AddItem(new GUIContent(strArray[0]), selectedIndex == 0, new GenericMenu.MenuFunction(this.SetShowVolumePreVis));
if (umbraDataSize > 0)
{
genericMenu.AddItem(new GUIContent(strArray[1]), selectedIndex == 1, new GenericMenu.MenuFunction(this.SetShowVolumeCulling));
}
else
{
genericMenu.AddDisabledItem(new GUIContent(strArray[1]));
}
genericMenu.Popup(popupRect, selectedIndex);
}
return(this.m_PreVis);
}