private void OnGUI()
{
this.CheckForPlatformModuleChange();
if (ms_Styles == null)
{
ms_Styles = new Styles();
}
this.DrawMainToolbar();
SplitterGUILayout.BeginVerticalSplit(this.m_VertSplit, new GUILayoutOption[0]);
this.m_GraphPos = EditorGUILayout.BeginScrollView(this.m_GraphPos, ms_Styles.profilerGraphBackground, new GUILayoutOption[0]);
if (this.m_PrevLastFrame != ProfilerDriver.lastFrameIndex)
{
this.UpdateCharts();
this.m_PrevLastFrame = ProfilerDriver.lastFrameIndex;
}
int currentFrame = this.m_CurrentFrame;
Chart.ChartAction[] actionArray = new Chart.ChartAction[this.m_Charts.Length];
for (int i = 0; i < this.m_Charts.Length; i++)
{
ProfilerChart chart = this.m_Charts[i];
if (chart.active)
{
currentFrame = chart.DoChartGUI(currentFrame, this.m_CurrentArea, out actionArray[i]);
}
}
bool flag = false;
if (currentFrame != this.m_CurrentFrame)
{
this.SetCurrentFrame(currentFrame);
flag = true;
}
for (int j = 0; j < this.m_Charts.Length; j++)
{
ProfilerChart chart2 = this.m_Charts[j];
if (chart2.active)
{
if (actionArray[j] == Chart.ChartAction.Closed)
{
if (this.m_CurrentArea == j)
{
this.m_CurrentArea = ProfilerArea.CPU;
}
chart2.active = false;
}
else if (actionArray[j] == Chart.ChartAction.Activated)
{
this.m_CurrentArea = (ProfilerArea) j;
if ((this.m_CurrentArea != ProfilerArea.CPU) && (this.m_CPUHierarchyGUI.selectedIndex != -1))
{
this.ClearSelectedPropertyPath();
}
flag = true;
}
}
}
if (flag)
{
base.Repaint();
GUIUtility.ExitGUI();
}
EditorGUILayout.EndScrollView();
GUILayout.BeginVertical(new GUILayoutOption[0]);
switch (this.m_CurrentArea)
{
case ProfilerArea.CPU:
this.DrawCPUOrRenderingPane(this.m_CPUHierarchyGUI, this.m_CPUDetailHierarchyGUI, this.m_CPUTimelineGUI);
break;
case ProfilerArea.GPU:
this.DrawCPUOrRenderingPane(this.m_GPUHierarchyGUI, this.m_GPUDetailHierarchyGUI, null);
break;
case ProfilerArea.Memory:
this.DrawMemoryPane(this.m_ViewSplit);
break;
case ProfilerArea.Audio:
this.DrawAudioPane();
break;
case ProfilerArea.NetworkMessages:
this.DrawPane(this.m_CurrentArea);
break;
case ProfilerArea.NetworkOperations:
this.DrawNetworkOperationsPane();
break;
default:
this.DrawPane(this.m_CurrentArea);
break;
}
GUILayout.EndVertical();
SplitterGUILayout.EndVerticalSplit();
}