public AudioProfilerInfoWrapper(AudioProfilerInfo info, string assetName, string objectName, bool addToRoot) { this.info = info; this.assetName = assetName; this.objectName = objectName; this.addToRoot = addToRoot; }
private void DrawAudioPane() { EditorGUILayout.BeginHorizontal(EditorStyles.toolbar, new GUILayoutOption[0]); ProfilerAudioView profilerAudioView = this.m_ShowDetailedAudioPane; if (GUILayout.Toggle(profilerAudioView == ProfilerAudioView.Stats, "Stats", EditorStyles.toolbarButton, new GUILayoutOption[0])) { profilerAudioView = ProfilerAudioView.Stats; } if (GUILayout.Toggle(profilerAudioView == ProfilerAudioView.Channels, "Channels", EditorStyles.toolbarButton, new GUILayoutOption[0])) { profilerAudioView = ProfilerAudioView.Channels; } if (GUILayout.Toggle(profilerAudioView == ProfilerAudioView.Groups, "Groups", EditorStyles.toolbarButton, new GUILayoutOption[0])) { profilerAudioView = ProfilerAudioView.Groups; } if (GUILayout.Toggle(profilerAudioView == ProfilerAudioView.ChannelsAndGroups, "Channels and groups", EditorStyles.toolbarButton, new GUILayoutOption[0])) { profilerAudioView = ProfilerAudioView.ChannelsAndGroups; } if (profilerAudioView != this.m_ShowDetailedAudioPane) { this.m_ShowDetailedAudioPane = profilerAudioView; 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 flag2 = GUILayout.Toggle(@bool, "Show all groups (dev-builds only)", EditorStyles.toolbarButton, new GUILayoutOption[0]); if (@bool != flag2) { EditorPrefs.SetBool("AudioProfilerShowAllGroups", flag2); } } GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); Rect rect = GUILayoutUtility.GetRect(20f, 20000f, 10f, 10000f); Rect position = new Rect(rect.x, rect.y, 230f, rect.height); Rect rect2 = 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, ProfilerWindow.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 profilerProperty = this.CreateProperty(false); if (ProfilerWindow.CheckFrameData(profilerProperty)) { if (this.m_CurrentFrame == -1 || this.m_LastAudioProfilerFrame != this.m_CurrentFrame) { this.m_LastAudioProfilerFrame = this.m_CurrentFrame; AudioProfilerInfo[] audioProfilerInfo = profilerProperty.GetAudioProfilerInfo(); if (audioProfilerInfo != null && audioProfilerInfo.Length > 0) { List <AudioProfilerInfoWrapper> list = new List <AudioProfilerInfoWrapper>(); AudioProfilerInfo[] array = audioProfilerInfo; for (int i = 0; i < array.Length; i++) { AudioProfilerInfo info = array[i]; bool flag3 = (info.flags & 64) != 0; if (this.m_ShowDetailedAudioPane != ProfilerAudioView.Channels || !flag3) { if (this.m_ShowDetailedAudioPane != ProfilerAudioView.Groups || flag3) { list.Add(new AudioProfilerInfoWrapper(info, profilerProperty.GetAudioProfilerNameByOffset(info.assetNameOffset), profilerProperty.GetAudioProfilerNameByOffset(info.objectNameOffset), this.m_ShowDetailedAudioPane == ProfilerAudioView.Channels)); } } } this.m_AudioProfilerBackend.SetData(list); if (this.m_AudioProfilerView == null) { this.m_AudioProfilerView = new AudioProfilerView(this, this.m_AudioProfilerTreeViewState); this.m_AudioProfilerView.Init(rect2, this.m_AudioProfilerBackend); } } } if (this.m_AudioProfilerView != null) { this.m_AudioProfilerView.OnGUI(rect2, this.m_ShowDetailedAudioPane == ProfilerAudioView.Channels); } } profilerProperty.Cleanup(); } }