protected virtual void DrawItem(MemoryElement memoryElement, ref int row, int indent) { bool flag = this.m_MemorySelection.isSelected(memoryElement); MemoryTreeList.DrawBackground(row, flag); Rect rect = MemoryTreeList.GenerateRect(row); rect.x = 4f + (float)indent * 16f - 14f; Rect position = rect; position.width = 14f; if (memoryElement.ChildCount() > 0) { memoryElement.expanded = GUI.Toggle(position, memoryElement.expanded, GUIContent.none, MemoryTreeList.styles.foldout); } rect.x += 14f; if (flag) { this.m_SelectionOffset = (float)row * 16f; } if (Event.current.type == EventType.MouseDown && rect.Contains(Event.current.mousePosition)) { this.RowClicked(Event.current, memoryElement); } this.DrawData(rect, memoryElement, indent, row, flag); if (memoryElement.expanded) { this.DrawRecursiveData(memoryElement, ref row, indent + 1); } }
protected void EnsureVisible() { int num = 0; this.RecursiveFindSelected(this.m_Root, ref num); this.m_ScrollPosition.y = MemoryTreeList.Clamp(this.m_ScrollPosition.y, this.m_SelectionOffset - this.m_VisibleHeight, this.m_SelectionOffset - 16f); }
public MemoryTreeList(EditorWindow editorWindow, MemoryTreeList detailview) { this.m_EditorWindow = editorWindow; this.m_DetailView = detailview; this.m_ControlID = GUIUtility.GetPermanentControlID(); this.SetupSplitter(); }
public MemoryTreeList(IProfilerWindowController profilerWindow, MemoryTreeList detailview) { m_MemorySelection = new MemoryElementSelection(); m_ProfilerWindow = profilerWindow; m_DetailView = detailview; m_ControlID = GUIUtility.GetPermanentControlID(); SetupSplitter(); }
public MemoryTreeList(EditorWindow editorWindow, MemoryTreeList detailview) { m_MemorySelection = new MemoryElementSelection(); m_EditorWindow = editorWindow; m_DetailView = detailview; m_ControlID = GUIUtility.GetPermanentControlID(); SetupSplitter(); }
protected static void DrawBackground(int row, bool selected) { Rect position = MemoryTreeList.GenerateRect(row); GUIStyle gUIStyle = (row % 2 != 0) ? MemoryTreeList.styles.entryOdd : MemoryTreeList.styles.entryEven; if (Event.current.type == EventType.Repaint) { gUIStyle.Draw(position, GUIContent.none, false, false, selected, false); } }
protected static void DrawBackground(int row, bool selected) { Rect rect = MemoryTreeList.GenerateRect(row); GUIStyle guiStyle = row % 2 != 0 ? MemoryTreeList.styles.entryOdd : MemoryTreeList.styles.entryEven; if (Event.current.type != EventType.Repaint) { return; } guiStyle.Draw(rect, GUIContent.none, false, false, selected, false); }
private void Initialize() { int len = ProfilerDriver.maxHistoryLength - 1; this.m_Charts = new ProfilerChart[7]; Color[] colors = ProfilerColors.colors; for (ProfilerArea profilerArea = ProfilerArea.CPU; profilerArea < ProfilerArea.AreaCount; profilerArea++) { float dataScale = 1f; Chart.ChartType type = Chart.ChartType.Line; string[] graphStatisticsPropertiesForArea = ProfilerDriver.GetGraphStatisticsPropertiesForArea(profilerArea); int num = graphStatisticsPropertiesForArea.Length; if (profilerArea == ProfilerArea.GPU || profilerArea == ProfilerArea.CPU) { type = Chart.ChartType.StackedFill; dataScale = 0.001f; } ProfilerChart profilerChart = new ProfilerChart(profilerArea, type, dataScale, num); for (int i = 0; i < num; i++) { profilerChart.m_Series[i] = new ChartSeries(graphStatisticsPropertiesForArea[i], len, colors[i]); } this.m_Charts[(int)profilerArea] = profilerChart; } if (this.m_ReferenceListView == null) { this.m_ReferenceListView = new MemoryTreeList(this, null); } if (this.m_MemoryListView == null) { this.m_MemoryListView = new MemoryTreeListClickable(this, this.m_ReferenceListView); } this.UpdateCharts(); this.BuildColumns(); ProfilerChart[] charts = this.m_Charts; for (int j = 0; j < charts.Length; j++) { ProfilerChart profilerChart2 = charts[j]; profilerChart2.LoadAndBindSettings(); } }
private void Initialize() { int len = ProfilerDriver.maxHistoryLength - 1; this.m_Charts = new ProfilerChart[9]; Color[] colors = ProfilerColors.colors; for (ProfilerArea area = ProfilerArea.CPU; area < ProfilerArea.AreaCount; area += 1) { float dataScale = 1f; Chart.ChartType line = Chart.ChartType.Line; string[] graphStatisticsPropertiesForArea = ProfilerDriver.GetGraphStatisticsPropertiesForArea(area); int length = graphStatisticsPropertiesForArea.Length; switch (area) { case ProfilerArea.GPU: case ProfilerArea.CPU: line = Chart.ChartType.StackedFill; dataScale = 0.001f; break; } ProfilerChart chart = new ProfilerChart(area, line, dataScale, length); for (int i = 0; i < length; i++) { chart.m_Series[i] = new ChartSeries(graphStatisticsPropertiesForArea[i], len, colors[i]); } this.m_Charts[(int) area] = chart; } if (this.m_ReferenceListView == null) { this.m_ReferenceListView = new MemoryTreeList(this, null); } if (this.m_MemoryListView == null) { this.m_MemoryListView = new MemoryTreeListClickable(this, this.m_ReferenceListView); } this.UpdateCharts(); this.BuildColumns(); foreach (ProfilerChart chart2 in this.m_Charts) { chart2.LoadAndBindSettings(); } }
public MemoryTreeListClickable(EditorWindow editorWindow, MemoryTreeList detailview) : base(editorWindow, detailview) { }
public MemoryTreeListClickable(IProfilerWindowController profilerWindow, MemoryTreeList detailview) : base(profilerWindow, detailview) { }
private void Initialize() { int len = ProfilerDriver.maxHistoryLength - 1; this.m_Charts = new ProfilerChart[9]; Color[] colors = ProfilerColors.colors; for (ProfilerArea area = ProfilerArea.CPU; area < ProfilerArea.AreaCount; ++area) { float dataScale = 1f; Chart.ChartType type = Chart.ChartType.Line; string[] propertiesForArea = ProfilerDriver.GetGraphStatisticsPropertiesForArea(area); int length = propertiesForArea.Length; if (area == ProfilerArea.GPU || area == ProfilerArea.CPU) { type = Chart.ChartType.StackedFill; dataScale = 1f / 1000f; } ProfilerChart profilerChart = new ProfilerChart(area, type, dataScale, length); for (int index = 0; index < length; ++index) profilerChart.m_Series[index] = new ChartSeries(propertiesForArea[index], len, colors[index]); this.m_Charts[(int) area] = profilerChart; } if (this.m_ReferenceListView == null) this.m_ReferenceListView = new MemoryTreeList((EditorWindow) this, (MemoryTreeList) null); if (this.m_MemoryListView == null) this.m_MemoryListView = new MemoryTreeListClickable((EditorWindow) this, this.m_ReferenceListView); this.UpdateCharts(); this.BuildColumns(); foreach (ProfilerChart chart in this.m_Charts) chart.LoadAndBindSettings(); }