public override void DrawToolbar(Rect position) { EditorGUILayout.BeginHorizontal(EditorStyles.toolbar); m_ShowDetailedMemoryPane = (ProfilerMemoryView)EditorGUILayout.EnumPopup(m_ShowDetailedMemoryPane, EditorStyles.toolbarDropDownLeft, GUILayout.Width(70f)); GUILayout.Space(5f); if (m_ShowDetailedMemoryPane == ProfilerMemoryView.Detailed) { if (GUILayout.Button(GUIContent.Temp(UnityString.Format(Styles.takeSample.text, m_ProfilerWindow.ConnectedTargetName), Styles.takeSample.tooltip), EditorStyles.toolbarButton)) { RefreshMemoryData(); } m_GatherObjectReferences = GUILayout.Toggle(m_GatherObjectReferences, Styles.gatherObjectReferences, EditorStyles.toolbarButton); if (m_ProfilerWindow.ConnectedToEditor) { GUILayout.Label(Styles.memoryUsageInEditorDisclaimer, EditorStyles.toolbarButton); } } GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); }
void ViewChanged(ProfilerMemoryView view) { m_UIState.ViewArea.Clear(); m_MemoryModule.m_ShowDetailedMemoryPane = view; if (view == ProfilerMemoryView.Simple) { var frameIndex = ProfilerWindow.selectedFrameIndex; var dataAvailable = CheckMemoryStatsAvailablity(frameIndex); m_UIState.DetailedMenuLabel.text = "Simple"; UIElementsHelper.SetVisibility(m_UIState.DetailedToolbarSection, false); if (dataAvailable) { m_UIState.ViewArea.Add(m_UIState.SimpleView); m_AddedSimpleDataView = true; UpdateContent(frameIndex); } else { m_UIState.ViewArea.Add(m_UIState.NoDataView); m_AddedSimpleDataView = false; } } else { m_UIState.DetailedMenuLabel.text = "Detailed"; UIElementsHelper.SetVisibility(m_UIState.DetailedToolbarSection, true); // Detailed View doesn't differentiate between there being frame data or not because // 1. Clear doesn't clear out old snapshots so there totally could be data here // 2. Take Snapshot also doesn't require there to be any frame data // this special case will disappear together with the detailed view eventually m_UIState.ViewArea.Add(m_UIState.DetailedView); m_AddedSimpleDataView = false; } }
public override void OnEnable(IProfilerWindowController profilerWindow) { base.OnEnable(profilerWindow); instance = new WeakReference(this); if (m_ReferenceListView == null) { m_ReferenceListView = new MemoryTreeList(profilerWindow, null); } if (m_MemoryListView == null) { m_MemoryListView = new MemoryTreeListClickable(profilerWindow, m_ReferenceListView); } m_ShowDetailedMemoryPane = (ProfilerMemoryView)EditorPrefs.GetInt(k_ViewTypeSettingsKey, (int)ProfilerMemoryView.Simple); m_GatherObjectReferences = EditorPrefs.GetBool(k_GatherObjectReferencesSettingsKey, true); }
public override void OnEnable(IProfilerWindowController profilerWindow) { base.OnEnable(profilerWindow); instance = new WeakReference(this); if (m_ReferenceListView == null) { m_ReferenceListView = new MemoryTreeList(profilerWindow, null); } if (m_MemoryListView == null) { m_MemoryListView = new MemoryTreeListClickable(profilerWindow, m_ReferenceListView); } // Automatic Serialization on Domain Reload does not work yet as the base is abstract and the array on the ProfilerWindwo is of type ProfilerModuleBase m_ShowDetailedMemoryPane = (ProfilerMemoryView)EditorPrefs.GetInt(k_ViewTypeSettingsKey, (int)ProfilerMemoryView.Simple); m_GatherObjectReferences = EditorPrefs.GetBool(k_GatherObjectReferencesSettingsKey, true); }
public override void OnEnable(IProfilerWindowController profilerWindow) { base.OnEnable(profilerWindow); instance = new WeakReference(this); if (m_ReferenceListView == null) { m_ReferenceListView = new MemoryTreeList(profilerWindow, null); } if (m_MemoryListView == null) { m_MemoryListView = new MemoryTreeListClickable(profilerWindow, m_ReferenceListView); } if (m_ViewSplit == null || !m_ViewSplit.IsValid()) { m_ViewSplit = SplitterState.FromRelative(new[] { EditorPrefs.GetFloat(k_SplitterRelative0SettingsKey, 70f), EditorPrefs.GetFloat(k_SplitterRelative1SettingsKey, 30f) }, k_SplitterMinSizes, null); } m_ShowDetailedMemoryPane = (ProfilerMemoryView)EditorPrefs.GetInt(k_ViewTypeSettingsKey, (int)ProfilerMemoryView.Simple); m_GatherObjectReferences = EditorPrefs.GetBool(k_GatherObjectReferencesSettingsKey, true); }
private void DrawMemoryToolbar() { EditorGUILayout.BeginHorizontal(EditorStyles.toolbar, new GUILayoutOption[0]); this.m_ShowDetailedMemoryPane = (ProfilerMemoryView)EditorGUILayout.EnumPopup(this.m_ShowDetailedMemoryPane, EditorStyles.toolbarDropDown, new GUILayoutOption[] { GUILayout.Width(70f) }); GUILayout.Space(5f); if (this.m_ShowDetailedMemoryPane == ProfilerMemoryView.Detailed) { if (GUILayout.Button("Take Sample: " + this.m_AttachProfilerUI.GetConnectedProfiler(), EditorStyles.toolbarButton, new GUILayoutOption[0])) { this.RefreshMemoryData(); } if (this.m_AttachProfilerUI.IsEditor()) { GUILayout.Label("Memory usage in editor is not as it would be in a player", EditorStyles.toolbarButton, new GUILayoutOption[0]); } } GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); }
private void DrawMemoryToolbar() { EditorGUILayout.BeginHorizontal(EditorStyles.toolbar, new GUILayoutOption[0]); GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.Width(70f) }; this.m_ShowDetailedMemoryPane = (ProfilerMemoryView) EditorGUILayout.EnumPopup(this.m_ShowDetailedMemoryPane, EditorStyles.toolbarDropDown, options); GUILayout.Space(5f); if (this.m_ShowDetailedMemoryPane == ProfilerMemoryView.Detailed) { if (GUILayout.Button("Take Sample: " + this.m_AttachProfilerUI.GetConnectedProfiler(), EditorStyles.toolbarButton, new GUILayoutOption[0])) { this.RefreshMemoryData(); } if (this.m_AttachProfilerUI.IsEditor()) { GUILayout.Label("Memory usage in editor is not as it would be in a player", EditorStyles.toolbarButton, new GUILayoutOption[0]); } } GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); }
private void DrawMemoryToolbar() { EditorGUILayout.BeginHorizontal(EditorStyles.toolbar, new GUILayoutOption[0]); this.m_ShowDetailedMemoryPane = (ProfilerMemoryView) EditorGUILayout.EnumPopup((Enum) this.m_ShowDetailedMemoryPane, EditorStyles.toolbarDropDown, new GUILayoutOption[1] { GUILayout.Width(70f) }); GUILayout.Space(5f); if (this.m_ShowDetailedMemoryPane == ProfilerMemoryView.Detailed) { if (GUILayout.Button("Take Sample: " + this.m_AttachProfilerUI.GetConnectedProfiler(), EditorStyles.toolbarButton, new GUILayoutOption[0])) this.RefreshMemoryData(); this.m_GatherObjectReferences = GUILayout.Toggle(this.m_GatherObjectReferences, ProfilerWindow.ms_Styles.gatherObjectReferences, EditorStyles.toolbarButton, new GUILayoutOption[0]); if (this.m_AttachProfilerUI.IsEditor()) GUILayout.Label("Memory usage in editor is not as it would be in a player", EditorStyles.toolbarButton, new GUILayoutOption[0]); } GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); }
public ProfilerWindow() { float[] relativeSizes = new float[] { 50f, 50f }; int[] minSizes = new int[] { 50, 50 }; this.m_VertSplit = new SplitterState(relativeSizes, minSizes, null); float[] singleArray2 = new float[] { 70f, 30f }; int[] numArray2 = new int[] { 450, 50 }; this.m_ViewSplit = new SplitterState(singleArray2, numArray2, null); float[] singleArray3 = new float[] { 20f, 80f }; int[] numArray3 = new int[] { 100, 100 }; this.m_NetworkSplit = new SplitterState(singleArray3, numArray3, null); this.m_AttachProfilerUI = new AttachProfilerUI(); this.m_GraphPos = Vector2.zero; this.m_PaneScroll = new Vector2[9]; this.m_PaneScroll_AudioChannels = Vector2.zero; this.m_PaneScroll_AudioDSP = Vector2.zero; this.m_PaneScroll_AudioClips = Vector2.zero; this.m_ViewType = ProfilerViewType.Hierarchy; this.m_CurrentArea = ProfilerArea.CPU; this.m_ShowDetailedMemoryPane = ProfilerMemoryView.Simple; this.m_ShowDetailedAudioPane = ProfilerAudioView.Stats; this.m_ShowInactiveDSPChains = false; this.m_HighlightAudibleDSPChains = true; this.m_DSPGraphZoomFactor = 1f; this.m_CurrentFrame = -1; this.m_LastFrameFromTick = -1; this.m_PrevLastFrame = -1; this.m_LastAudioProfilerFrame = -1; this.m_ChartOldMax = new float[] { -1f, -1f }; this.m_ChartMaxClamp = 70000f; this.m_TimelineViewDetail = false; this.m_GatherObjectReferences = true; this.m_AudioProfilerGroupView = null; this.m_AudioProfilerClipView = null; this.m_SelectedMemRecordMode = ProfilerMemoryRecordMode.None; this.s_CheckMark = '✔'; this.msgNames = new string[] { "UserMessage", "ObjectDestroy", "ClientRpc", "ObjectSpawn", "Owner", "Command", "LocalPlayerTransform", "SyncEvent", "SyncVars", "SyncList", "ObjectSpawnScene", "NetworkInfo", "SpawnFinished", "ObjectHide", "CRC", "ClientAuthority" }; this.msgFoldouts = new bool[] { true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, false }; }