private void OnGUI() { this.CheckForPlatformModuleChange(); if (ProfilerWindow.ms_Styles == null) { ProfilerWindow.ms_Styles = new ProfilerWindow.Styles(); } if (!this.m_HasProfilerLicense) { GUILayout.Label(ProfilerWindow.ms_Styles.noLicense, EditorStyles.largeLabel, new GUILayoutOption[0]); return; } this.DrawMainToolbar(); SplitterGUILayout.BeginVerticalSplit(this.m_VertSplit, new GUILayoutOption[0]); this.m_GraphPos = EditorGUILayout.BeginScrollView(this.m_GraphPos, ProfilerWindow.ms_Styles.profilerGraphBackground, new GUILayoutOption[0]); if (this.m_PrevLastFrame != ProfilerDriver.lastFrameIndex) { this.UpdateCharts(); this.m_PrevLastFrame = ProfilerDriver.lastFrameIndex; } int num = this.m_CurrentFrame; Chart.ChartAction[] array = new Chart.ChartAction[this.m_Charts.Length]; for (int i = 0; i < this.m_Charts.Length; i++) { ProfilerChart profilerChart = this.m_Charts[i]; if (profilerChart.active) { num = profilerChart.DoChartGUI(num, this.m_CurrentArea, out array[i]); } } bool flag = false; if (num != this.m_CurrentFrame) { this.SetCurrentFrame(num); flag = true; } for (int j = 0; j < this.m_Charts.Length; j++) { ProfilerChart profilerChart2 = this.m_Charts[j]; if (profilerChart2.active) { if (array[j] == Chart.ChartAction.Closed) { if (this.m_CurrentArea == (ProfilerArea)j) { this.m_CurrentArea = ProfilerArea.CPU; } profilerChart2.active = false; } else { if (array[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(); } GUILayout.EndScrollView(); GUILayout.BeginVertical(new GUILayoutOption[0]); switch (this.m_CurrentArea) { case ProfilerArea.CPU: this.DrawCPUOrRenderingPane(this.m_CPUHierarchyGUI, this.m_CPUDetailHierarchyGUI, this.m_CPUTimelineGUI); goto IL_255; case ProfilerArea.GPU: this.DrawCPUOrRenderingPane(this.m_GPUHierarchyGUI, this.m_GPUDetailHierarchyGUI, null); goto IL_255; case ProfilerArea.Memory: this.DrawMemoryPane(this.m_ViewSplit); goto IL_255; case ProfilerArea.Audio: this.DrawAudioPane(); goto IL_255; } this.DrawPane(this.m_CurrentArea); IL_255: GUILayout.EndVertical(); SplitterGUILayout.EndVerticalSplit(); }
private void OnGUI() { this.CheckForPlatformModuleChange(); if (ProfilerWindow.ms_Styles == null) ProfilerWindow.ms_Styles = new ProfilerWindow.Styles(); this.DrawMainToolbar(); SplitterGUILayout.BeginVerticalSplit(this.m_VertSplit); this.m_GraphPos = EditorGUILayout.BeginScrollView(this.m_GraphPos, ProfilerWindow.ms_Styles.profilerGraphBackground, new GUILayoutOption[0]); if (this.m_PrevLastFrame != ProfilerDriver.lastFrameIndex) { this.UpdateCharts(); this.m_PrevLastFrame = ProfilerDriver.lastFrameIndex; } int num = this.m_CurrentFrame; Chart.ChartAction[] chartActionArray = new Chart.ChartAction[this.m_Charts.Length]; for (int index = 0; index < this.m_Charts.Length; ++index) { ProfilerChart chart = this.m_Charts[index]; if (chart.active) num = chart.DoChartGUI(num, this.m_CurrentArea, out chartActionArray[index]); } bool flag = false; if (num != this.m_CurrentFrame) { this.SetCurrentFrame(num); flag = true; } for (int index = 0; index < this.m_Charts.Length; ++index) { ProfilerChart chart = this.m_Charts[index]; if (chart.active) { if (chartActionArray[index] == Chart.ChartAction.Closed) { if (this.m_CurrentArea == (ProfilerArea) index) this.m_CurrentArea = ProfilerArea.CPU; chart.active = false; } else if (chartActionArray[index] == Chart.ChartAction.Activated) { this.m_CurrentArea = (ProfilerArea) index; if (this.m_CurrentArea != ProfilerArea.CPU && this.m_CPUHierarchyGUI.selectedIndex != -1) this.ClearSelectedPropertyPath(); flag = true; } } } if (flag) { this.Repaint(); GUIUtility.ExitGUI(); } GUILayout.EndScrollView(); GUILayout.BeginVertical(); 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, (ProfilerTimelineGUI) 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(); }