public void DoGUI(GUIStyle headerStyle, FrameDataView frameDataView, IList <int> selection) { if (frameDataView == null || !frameDataView.IsValid() || selection.Count == 0) { base.DrawEmptyPane(headerStyle); } else { int selectedId = selection[0]; this.InitIfNeeded(); this.UpdateIfNeeded(frameDataView, selectedId); GUILayout.Label(this.m_TotalSelectedPropertyTimeLabel, EditorStyles.label, new GUILayoutOption[0]); SplitterGUILayout.BeginVerticalSplit(this.m_VertSplit, new GUILayoutOption[] { GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true) }); Rect r = EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]); this.m_CalleesTreeView.OnGUI(r); EditorGUILayout.EndHorizontal(); r = EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]); this.m_CallersTreeView.OnGUI(r); EditorGUILayout.EndHorizontal(); SplitterGUILayout.EndVerticalSplit(); } }
public void DoGUI(GUIStyle headerStyle, FrameDataView frameDataView, IList <int> selection) { if (frameDataView == null || !frameDataView.IsValid() || selection.Count == 0) { DrawEmptyPane(headerStyle); return; } var selectedId = selection[0]; InitIfNeeded(); UpdateIfNeeded(frameDataView, selectedId); GUILayout.Label(m_TotalSelectedPropertyTimeLabel, EditorStyles.label); SplitterGUILayout.BeginVerticalSplit(m_VertSplit, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)); // Callees var rect = EditorGUILayout.BeginHorizontal(); m_CalleesTreeView.OnGUI(rect); EditorGUILayout.EndHorizontal(); // Callers rect = EditorGUILayout.BeginHorizontal(); m_CallersTreeView.OnGUI(rect); EditorGUILayout.EndHorizontal(); SplitterGUILayout.EndVerticalSplit(); }
public void DoGUI(FrameDataView frameDataView) { this.InitIfNeeded(); bool flag = frameDataView != null && frameDataView.IsValid(); this.m_TreeView.SetFrameDataView(frameDataView); bool flag2 = flag && this.m_DetailedViewType != ProfilerFrameDataHierarchyView.DetailedViewType.None; if (flag2) { SplitterGUILayout.BeginHorizontalSplit(this.m_DetailedViewSpliterState, new GUILayoutOption[0]); } GUILayout.BeginVertical(new GUILayoutOption[0]); this.DrawToolbar(frameDataView, flag2); if (!flag) { GUILayout.Label(ProfilerFrameDataViewBase.BaseStyles.noData, ProfilerFrameDataViewBase.BaseStyles.label, new GUILayoutOption[0]); } else { Rect rect = GUILayoutUtility.GetRect(GUIContent.none, GUIStyle.none, new GUILayoutOption[] { GUILayout.ExpandHeight(true), GUILayout.ExpandHeight(true) }); this.m_TreeView.OnGUI(rect); } GUILayout.EndVertical(); if (flag2) { GUILayout.BeginVertical(new GUILayoutOption[0]); EditorGUILayout.BeginHorizontal(ProfilerFrameDataViewBase.BaseStyles.toolbar, new GUILayoutOption[0]); this.DrawDetailedViewPopup(); GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); ProfilerFrameDataHierarchyView.DetailedViewType detailedViewType = this.m_DetailedViewType; if (detailedViewType != ProfilerFrameDataHierarchyView.DetailedViewType.Objects) { if (detailedViewType == ProfilerFrameDataHierarchyView.DetailedViewType.CallersAndCallees) { this.detailedCallsView.DoGUI(ProfilerFrameDataViewBase.BaseStyles.header, frameDataView, this.m_TreeView.GetSelection()); } } else { this.detailedObjectsView.DoGUI(ProfilerFrameDataViewBase.BaseStyles.header, frameDataView, this.m_TreeView.GetSelection()); } GUILayout.EndVertical(); SplitterGUILayout.EndHorizontalSplit(); } this.HandleKeyboardEvents(); }
public void DoGUI(GUIStyle headerStyle, FrameDataView frameDataView, IList <int> selection) { if (frameDataView == null || !frameDataView.IsValid() || selection.Count == 0) { DrawEmptyPane(headerStyle); return; } InitIfNeeded(); UpdateIfNeeded(frameDataView, selection[0]); string callstack = null; var selectedSampleId = m_TreeView.GetSelectedFrameDataViewId(); if (selectedSampleId != -1) { callstack = frameDataView.ResolveItemCallstack(selectedSampleId, m_TreeView.state.selectedIDs[0]); } var showCallstack = !string.IsNullOrEmpty(callstack); if (showCallstack) { SplitterGUILayout.BeginVerticalSplit(m_VertSplit, Styles.expandedArea); } // Detailed list var rect = EditorGUILayout.BeginVertical(Styles.expandedArea); m_TreeView.OnGUI(rect); EditorGUILayout.EndVertical(); if (showCallstack) { // Callstack area EditorGUILayout.BeginVertical(Styles.expandedArea); m_CallstackScrollViewPos = EditorGUILayout.BeginScrollView(m_CallstackScrollViewPos, Styles.callstackScroll); var text = kCallstackText + '\n' + callstack; EditorGUILayout.TextArea(text, Styles.callstackTextArea); EditorGUILayout.EndScrollView(); EditorGUILayout.EndVertical(); SplitterGUILayout.EndVerticalSplit(); } }
public void DoGUI(GUIStyle headerStyle, FrameDataView frameDataView, IList <int> selection) { if (frameDataView == null || !frameDataView.IsValid() || selection.Count == 0) { base.DrawEmptyPane(headerStyle); } else { this.InitIfNeeded(); this.UpdateIfNeeded(frameDataView, selection[0]); string text = null; int selectedFrameDataViewId = this.m_TreeView.GetSelectedFrameDataViewId(); if (selectedFrameDataViewId != -1) { text = frameDataView.ResolveItemCallstack(selectedFrameDataViewId, this.m_TreeView.state.selectedIDs[0]); } bool flag = !string.IsNullOrEmpty(text); if (flag) { SplitterGUILayout.BeginVerticalSplit(this.m_VertSplit, ProfilerDetailedView.Styles.expandedArea, new GUILayoutOption[0]); } Rect rect = EditorGUILayout.BeginVertical(ProfilerDetailedView.Styles.expandedArea, new GUILayoutOption[0]); this.m_TreeView.OnGUI(rect); EditorGUILayout.EndVertical(); if (flag) { EditorGUILayout.BeginVertical(ProfilerDetailedView.Styles.expandedArea, new GUILayoutOption[0]); this.m_CallstackScrollViewPos = EditorGUILayout.BeginScrollView(this.m_CallstackScrollViewPos, ProfilerDetailedView.Styles.callstackScroll, new GUILayoutOption[0]); string text2 = ProfilerDetailedObjectsView.kCallstackText + '\n' + text; EditorGUILayout.TextArea(text2, ProfilerDetailedView.Styles.callstackTextArea, new GUILayoutOption[0]); EditorGUILayout.EndScrollView(); EditorGUILayout.EndVertical(); SplitterGUILayout.EndVerticalSplit(); } } }
public void DoGUI(FrameDataView frameDataView) { InitIfNeeded(); var isDataAvailable = frameDataView != null && frameDataView.IsValid(); m_TreeView.SetFrameDataView(frameDataView); var showDetailedView = isDataAvailable && m_DetailedViewType != DetailedViewType.None; if (showDetailedView) { SplitterGUILayout.BeginHorizontalSplit(m_DetailedViewSpliterState); } // Hierarchy view area GUILayout.BeginVertical(); DrawToolbar(frameDataView, showDetailedView); if (!isDataAvailable) { GUILayout.Label(BaseStyles.noData, BaseStyles.label); } else { var rect = GUILayoutUtility.GetRect(GUIContent.none, GUIStyle.none, GUILayout.ExpandHeight(true), GUILayout.ExpandHeight(true)); m_TreeView.OnGUI(rect); } GUILayout.EndVertical(); if (showDetailedView) { GUILayout.BeginVertical(); // Detailed view area EditorGUILayout.BeginHorizontal(BaseStyles.toolbar); DrawDetailedViewPopup(); GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); switch (m_DetailedViewType) { case DetailedViewType.Objects: detailedObjectsView.DoGUI(BaseStyles.header, frameDataView, m_TreeView.GetSelection()); break; case DetailedViewType.CallersAndCallees: detailedCallsView.DoGUI(BaseStyles.header, frameDataView, m_TreeView.GetSelection()); break; } GUILayout.EndVertical(); SplitterGUILayout.EndHorizontalSplit(); } HandleKeyboardEvents(); }
public void DoGUI(FrameDataView frameDataView) { InitIfNeeded(); var collectingSamples = ProfilerDriver.enabled && (ProfilerDriver.profileEditor || EditorApplication.isPlaying); var isSearchAllowed = string.IsNullOrEmpty(treeView.searchString) || !(collectingSamples && ProfilerDriver.deepProfiling); var isDataAvailable = frameDataView != null && frameDataView.IsValid(); if (isDataAvailable && isSearchAllowed) { if (isDataAvailable) { m_TreeView.SetFrameDataView(frameDataView); } } var showDetailedView = isDataAvailable && m_DetailedViewType != DetailedViewType.None; if (showDetailedView) { SplitterGUILayout.BeginHorizontalSplit(m_DetailedViewSpliterState); } // Hierarchy view area GUILayout.BeginVertical(); DrawToolbar(frameDataView, showDetailedView); if (!isDataAvailable) { GUILayout.Label(BaseStyles.noData, BaseStyles.label); } else if (!isSearchAllowed) { GUILayout.Label(BaseStyles.disabledSearchText, BaseStyles.label); } else { var rect = GUILayoutUtility.GetRect(GUIContent.none, GUIStyle.none, GUILayout.ExpandHeight(true), GUILayout.ExpandHeight(true)); m_TreeView.OnGUI(rect); } GUILayout.EndVertical(); if (showDetailedView) { GUILayout.BeginVertical(); // Detailed view area EditorGUILayout.BeginHorizontal(BaseStyles.toolbar); DrawDetailedViewPopup(); GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); switch (m_DetailedViewType) { case DetailedViewType.Objects: detailedObjectsView.DoGUI(BaseStyles.header, frameDataView, m_TreeView.GetSelection()); break; case DetailedViewType.CallersAndCallees: detailedCallsView.DoGUI(BaseStyles.header, frameDataView, m_TreeView.GetSelection()); break; } GUILayout.EndVertical(); SplitterGUILayout.EndHorizontalSplit(); } HandleKeyboardEvents(); }