public override int DoChartGUI(int currentFrame, ProfilerArea currentArea, out Chart.ChartAction action) { int result = base.DoChartGUI(currentFrame, currentArea, out action); if (this.m_Markers != null && this.showMarkers) { Rect lastRect = GUILayoutUtility.GetLastRect(); lastRect.xMin += 170f; for (int i = 0; i < this.m_Markers.Length; i++) { EventMarker eventMarker = this.m_Markers[i]; Color color = ProfilerColors.colors[(int)(checked ((IntPtr)(unchecked ((ulong)eventMarker.objectInstanceId % (ulong)((long)ProfilerColors.colors.Length)))))]; Chart.DrawVerticalLine(eventMarker.frame, this.m_Data, lastRect, color.AlphaMultiplied(0.3f), color.AlphaMultiplied(0.4f), 1f); } this.DrawMarkerLabels(this.m_Data, lastRect, this.m_Markers, this.m_MarkerNames); } return(result); }
public int DoChartGUI(int currentFrame, ProfilerArea currentArea, out Chart.ChartAction action) { if (Event.current.type == EventType.Repaint) { string[] strArray = new string[this.m_Series.Length]; for (int index = 0; index < this.m_Series.Length; ++index) { int statisticsIdentifier = ProfilerDriver.GetStatisticsIdentifier(!this.m_Data.hasOverlay ? this.m_Series[index].identifierName : "Selected" + this.m_Series[index].identifierName); strArray[index] = ProfilerDriver.GetFormattedStatisticsValue(currentFrame, statisticsIdentifier); } this.m_Data.selectedLabels = strArray; } if (this.m_Icon == null) { this.m_Icon = EditorGUIUtility.TextContentWithIcon(this.GetLocalizedChartName(), "Profiler." + Enum.GetName(typeof(ProfilerArea), (object)this.m_Area)); } return(this.m_Chart.DoGUI(this.m_Type, currentFrame, this.m_Data, this.m_Area, currentArea == this.m_Area, this.m_Icon, out action)); }
public int DoChartGUI(int currentFrame, ProfilerArea currentArea, out Chart.ChartAction action) { if (Event.current.type == EventType.Repaint) { string[] array = new string[this.m_Series.Length]; for (int i = 0; i < this.m_Series.Length; i++) { string propertyName = (!this.m_Data.hasOverlay) ? this.m_Series[i].identifierName : ("Selected" + this.m_Series[i].identifierName); int statisticsIdentifier = ProfilerDriver.GetStatisticsIdentifier(propertyName); array[i] = ProfilerDriver.GetFormattedStatisticsValue(currentFrame, statisticsIdentifier); } this.m_Data.selectedLabels = array; } if (this.m_Icon == null) { this.m_Icon = EditorGUIUtility.TextContent("Profiler." + Enum.GetName(typeof(ProfilerArea), this.m_Area)); } return(this.m_Chart.DoGUI(this.m_Type, currentFrame, this.m_Data, this.m_Area, currentArea == this.m_Area, this.m_Icon, out action)); }
public int DoGUI(Chart.ChartType type, int selectedFrame, ChartData cdata, ProfilerArea area, bool active, GUIContent icon, out Chart.ChartAction action) { action = Chart.ChartAction.None; int result; if (cdata == null) { result = selectedFrame; } else { int numberOfFrames = cdata.NumberOfFrames; if (Chart.ms_Styles == null) { Chart.ms_Styles = new Chart.Styles(); } this.m_chartControlID = GUIUtility.GetControlID(Chart.s_ChartHash, FocusType.Keyboard); Rect rect = GUILayoutUtility.GetRect(GUIContent.none, Chart.ms_Styles.background, new GUILayoutOption[] { GUILayout.MinHeight(120f) }); Rect rect2 = rect; rect2.x += 170f; rect2.width -= 170f; Event current = Event.current; if (current.GetTypeForControl(this.m_chartControlID) == EventType.MouseDown && rect.Contains(current.mousePosition)) { action = Chart.ChartAction.Activated; } if (this.m_DragItemIndex == -1) { selectedFrame = this.HandleFrameSelectionEvents(selectedFrame, this.m_chartControlID, rect2, cdata, numberOfFrames); } Rect rect3 = rect2; rect3.x -= 170f; rect3.width = 170f; GUI.Label(new Rect(rect3.x, rect3.y, rect3.width, 20f), GUIContent.Temp("", icon.tooltip)); if (current.type == EventType.Repaint) { Chart.ms_Styles.rightPane.Draw(rect2, false, false, active, false); Chart.ms_Styles.leftPane.Draw(rect3, EditorGUIUtility.TempContent(icon.text), false, false, active, false); if (this.m_NotSupportedWarning == null) { rect2.height -= 1f; if (type == Chart.ChartType.StackedFill) { this.DrawChartStacked(selectedFrame, cdata, rect2); } else { this.DrawChartLine(selectedFrame, cdata, rect2); } } else { Rect position = rect2; position.x += 56.1000023f; position.y += 43f; GUI.Label(position, this.m_NotSupportedWarning, EditorStyles.boldLabel); } rect3.x += 10f; rect3.y += 10f; GUIStyle.none.Draw(rect3, EditorGUIUtility.TempContent(icon.image), false, false, false, false); rect3.x += 40f; this.DrawLabelDragger(type, rect3, cdata); } else { rect3.y += 10f; this.LabelDraggerDrag(this.m_chartControlID, type, cdata, rect3, active); } if (area == ProfilerArea.GPU) { GUI.Label(new Rect(rect.x + 170f - (float)Chart.ms_Styles.performanceWarning.image.width, rect.yMax - (float)Chart.ms_Styles.performanceWarning.image.height - 2f, (float)Chart.ms_Styles.performanceWarning.image.width, (float)Chart.ms_Styles.performanceWarning.image.height), Chart.ms_Styles.performanceWarning); } if (GUI.Button(new Rect(rect.x + 170f - 13f - 2f, rect.y + 2f, 13f, 13f), GUIContent.none, Chart.ms_Styles.closeButton)) { action = Chart.ChartAction.Closed; } result = selectedFrame; } return(result); }
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(); } 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); 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(); }
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(); }
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(); }