public AudioProfilerViewColumnHeader(AudioProfilerTreeViewState state, AudioProfilerBackend backend) { this.m_TreeViewState = state; this.m_Backend = backend; this.minColumnWidth = 10f; this.dragWidth = 6f; }
private void DrawAudioPane() { EditorGUILayout.BeginHorizontal(EditorStyles.toolbar, new GUILayoutOption[0]); ProfilerAudioView showDetailedAudioPane = this.m_ShowDetailedAudioPane; if (GUILayout.Toggle(showDetailedAudioPane == ProfilerAudioView.Stats, "Stats", EditorStyles.toolbarButton, new GUILayoutOption[0])) { showDetailedAudioPane = ProfilerAudioView.Stats; } if (GUILayout.Toggle(showDetailedAudioPane == ProfilerAudioView.Channels, "Channels", EditorStyles.toolbarButton, new GUILayoutOption[0])) { showDetailedAudioPane = ProfilerAudioView.Channels; } if (GUILayout.Toggle(showDetailedAudioPane == ProfilerAudioView.Groups, "Groups", EditorStyles.toolbarButton, new GUILayoutOption[0])) { showDetailedAudioPane = ProfilerAudioView.Groups; } if (GUILayout.Toggle(showDetailedAudioPane == ProfilerAudioView.ChannelsAndGroups, "Channels and groups", EditorStyles.toolbarButton, new GUILayoutOption[0])) { showDetailedAudioPane = ProfilerAudioView.ChannelsAndGroups; } if (showDetailedAudioPane != this.m_ShowDetailedAudioPane) { this.m_ShowDetailedAudioPane = showDetailedAudioPane; this.m_LastAudioProfilerFrame = -1; } if (this.m_ShowDetailedAudioPane == ProfilerAudioView.Stats) { GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); this.DrawOverviewText(this.m_CurrentArea); } else { GUILayout.Space(5f); bool flag = GUILayout.Toggle(AudioUtil.resetAllAudioClipPlayCountsOnPlay, "Reset play count on play", EditorStyles.toolbarButton, new GUILayoutOption[0]); if (flag != AudioUtil.resetAllAudioClipPlayCountsOnPlay) { AudioUtil.resetAllAudioClipPlayCountsOnPlay = flag; } if (Unsupported.IsDeveloperBuild()) { GUILayout.Space(5f); bool @bool = EditorPrefs.GetBool("AudioProfilerShowAllGroups"); bool flag3 = GUILayout.Toggle(@bool, "Show all groups (dev-builds only)", EditorStyles.toolbarButton, new GUILayoutOption[0]); if (@bool != flag3) { EditorPrefs.SetBool("AudioProfilerShowAllGroups", flag3); } } GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); Rect rect = GUILayoutUtility.GetRect(20f, 20000f, (float) 10f, (float) 10000f); Rect position = new Rect(rect.x, rect.y, 230f, rect.height); Rect rect3 = new Rect(position.xMax, rect.y, rect.width - position.width, rect.height); string overviewText = ProfilerDriver.GetOverviewText(this.m_CurrentArea, this.GetActiveVisibleFrameIndex()); Vector2 vector = EditorStyles.wordWrappedLabel.CalcSize(GUIContent.Temp(overviewText)); this.m_PaneScroll[(int) this.m_CurrentArea] = GUI.BeginScrollView(position, this.m_PaneScroll[(int) this.m_CurrentArea], new Rect(0f, 0f, vector.x, vector.y)); GUI.Box(position, string.Empty, ms_Styles.background); GUI.Label(new Rect(3f, 3f, vector.x, vector.y), overviewText, EditorStyles.wordWrappedLabel); GUI.EndScrollView(); EditorGUI.DrawRect(new Rect(position.xMax - 1f, position.y, 1f, position.height), Color.black); if (this.m_AudioProfilerTreeViewState == null) { this.m_AudioProfilerTreeViewState = new AudioProfilerTreeViewState(); } if (this.m_AudioProfilerBackend == null) { this.m_AudioProfilerBackend = new AudioProfilerBackend(this.m_AudioProfilerTreeViewState); } ProfilerProperty property = this.CreateProperty(false); if (CheckFrameData(property)) { if ((this.m_CurrentFrame == -1) || (this.m_LastAudioProfilerFrame != this.m_CurrentFrame)) { this.m_LastAudioProfilerFrame = this.m_CurrentFrame; AudioProfilerInfo[] audioProfilerInfo = property.GetAudioProfilerInfo(); if ((audioProfilerInfo != null) && (audioProfilerInfo.Length > 0)) { List<AudioProfilerInfoWrapper> data = new List<AudioProfilerInfoWrapper>(); foreach (AudioProfilerInfo info in audioProfilerInfo) { bool flag4 = (info.flags & 0x40) != 0; if (((this.m_ShowDetailedAudioPane != ProfilerAudioView.Channels) || !flag4) && ((this.m_ShowDetailedAudioPane != ProfilerAudioView.Groups) || flag4)) { data.Add(new AudioProfilerInfoWrapper(info, property.GetAudioProfilerNameByOffset(info.assetNameOffset), property.GetAudioProfilerNameByOffset(info.objectNameOffset), this.m_ShowDetailedAudioPane == ProfilerAudioView.Channels)); } } this.m_AudioProfilerBackend.SetData(data); if (this.m_AudioProfilerView == null) { this.m_AudioProfilerView = new AudioProfilerView(this, this.m_AudioProfilerTreeViewState); this.m_AudioProfilerView.Init(rect3, this.m_AudioProfilerBackend); } } } if (this.m_AudioProfilerView != null) { this.m_AudioProfilerView.OnGUI(rect3, this.m_ShowDetailedAudioPane == ProfilerAudioView.Channels); } } property.Cleanup(); } }
public AudioProfilerView(EditorWindow editorWindow, AudioProfilerTreeViewState state) { this.m_EditorWindow = editorWindow; this.m_TreeViewState = state; }
public AudioProfilerBackend(AudioProfilerTreeViewState state) { this.m_TreeViewState = state; this.items = new List <AudioProfilerInfoWrapper>(); }
public AudioProfilerBackend(AudioProfilerTreeViewState state) { this.m_TreeViewState = state; this.items = new List<AudioProfilerInfoWrapper>(); }