예제 #1
0
        public void Init(Rect rect, AudioProfilerBackend backend)
        {
            if (this.m_HeaderStyle == null)
            {
                this.m_HeaderStyle = new GUIStyle("OL title");
            }
            this.m_HeaderStyle.alignment = TextAnchor.MiddleLeft;
            if (this.m_TreeView != null)
            {
                return;
            }
            this.m_Backend = backend;
            if (this.m_TreeViewState.columnWidths == null)
            {
                int num = AudioProfilerInfoHelper.GetLastColumnIndex() + 1;
                this.m_TreeViewState.columnWidths = new float[num];
                for (int i = 2; i < num; i++)
                {
                    this.m_TreeViewState.columnWidths[i] = (float)((i != 2 && i != 3 && (i < 11 || i > 16)) ? 60 : 75);
                }
                this.m_TreeViewState.columnWidths[0] = 140f;
                this.m_TreeViewState.columnWidths[1] = 140f;
            }
            this.m_TreeView = new TreeView(this.m_EditorWindow, this.m_TreeViewState);
            ITreeViewGUI        gui  = new AudioProfilerView.AudioProfilerViewGUI(this.m_TreeView);
            ITreeViewDataSource data = new AudioProfilerView.AudioProfilerDataSource(this.m_TreeView, this.m_Backend);

            this.m_TreeView.Init(rect, data, gui, null);
            this.m_ColumnHeader = new AudioProfilerView.AudioProfilerViewColumnHeader(this.m_TreeViewState, this.m_Backend);
            this.m_ColumnHeader.columnWidths   = this.m_TreeViewState.columnWidths;
            this.m_ColumnHeader.minColumnWidth = 30f;
            TreeView expr_15A = this.m_TreeView;

            expr_15A.selectionChangedCallback = (Action <int[]>)Delegate.Combine(expr_15A.selectionChangedCallback, new Action <int[]>(this.OnTreeSelectionChanged));
        }
예제 #2
0
        public void Init(Rect rect, AudioProfilerBackend backend)
        {
            this.m_HeaderStyle = "PR Label";
            if (this.m_TreeView != null)
            {
                return;
            }
            this.m_Backend = backend;
            if (this.m_TreeViewState.columnWidths == null)
            {
                int num = AudioProfilerInfoHelper.GetLastColumnIndex() + 1;
                this.m_TreeViewState.columnWidths = new float[num];
                for (int i = 0; i < num; i++)
                {
                    this.m_TreeViewState.columnWidths[i] = (float)((i < 18) ? 55 : 80);
                }
                this.m_TreeViewState.columnWidths[0] = 200f;
                this.m_TreeViewState.columnWidths[1] = 200f;
                this.m_TreeViewState.columnWidths[2] = 80f;
                this.m_TreeViewState.columnWidths[3] = 80f;
            }
            this.m_TreeView = new TreeView(this.m_EditorWindow, this.m_TreeViewState);
            ITreeViewGUI        gui  = new AudioProfilerView.AudioProfilerViewGUI(this.m_TreeView);
            ITreeViewDataSource data = new AudioProfilerView.AudioProfilerDataSource(this.m_TreeView, this.m_Backend);

            this.m_TreeView.Init(rect, data, gui, null);
            this.m_ColumnHeader = new AudioProfilerView.AudioProfilerViewColumnHeader(this.m_TreeViewState, this.m_Backend);
            this.m_ColumnHeader.columnWidths   = this.m_TreeViewState.columnWidths;
            this.m_ColumnHeader.minColumnWidth = 30f;
            TreeView expr_14C = this.m_TreeView;

            expr_14C.selectionChangedCallback = (Action <int[]>)Delegate.Combine(expr_14C.selectionChangedCallback, new Action <int[]>(this.OnTreeSelectionChanged));
        }
예제 #3
0
 public AudioProfilerViewColumnHeader(AudioProfilerTreeViewState state, AudioProfilerBackend backend)
 {
     this.m_TreeViewState = state;
     this.m_Backend       = backend;
     this.minColumnWidth  = 10f;
     this.dragWidth       = 6f;
 }
 public void Init(Rect rect, AudioProfilerBackend backend)
 {
   if (this.m_HeaderStyle == null)
     this.m_HeaderStyle = new GUIStyle((GUIStyle) "OL title");
   this.m_HeaderStyle.alignment = TextAnchor.MiddleLeft;
   if (this.m_TreeView != null)
     return;
   this.m_Backend = backend;
   if (this.m_TreeViewState.columnWidths == null)
   {
     int length = AudioProfilerInfoHelper.GetLastColumnIndex() + 1;
     this.m_TreeViewState.columnWidths = new float[length];
     for (int index = 2; index < length; ++index)
       this.m_TreeViewState.columnWidths[index] = index == 2 || index == 3 || index >= 11 && index <= 16 ? 75f : 60f;
     this.m_TreeViewState.columnWidths[0] = 140f;
     this.m_TreeViewState.columnWidths[1] = 140f;
   }
   this.m_TreeView = new TreeView(this.m_EditorWindow, (TreeViewState) this.m_TreeViewState);
   ITreeViewGUI gui = (ITreeViewGUI) new AudioProfilerView.AudioProfilerViewGUI(this.m_TreeView);
   ITreeViewDataSource data = (ITreeViewDataSource) new AudioProfilerView.AudioProfilerDataSource(this.m_TreeView, this.m_Backend);
   this.m_TreeView.Init(rect, data, gui, (ITreeViewDragging) null);
   this.m_ColumnHeader = new AudioProfilerView.AudioProfilerViewColumnHeader(this.m_TreeViewState, this.m_Backend);
   this.m_ColumnHeader.columnWidths = this.m_TreeViewState.columnWidths;
   this.m_ColumnHeader.minColumnWidth = 30f;
   this.m_TreeView.selectionChangedCallback += new System.Action<int[]>(this.OnTreeSelectionChanged);
 }
예제 #5
0
 public void Init(Rect rect, AudioProfilerBackend backend)
 {
     this.m_HeaderStyle = "PR Label";
     if (this.m_TreeView == null)
     {
         this.m_Backend = backend;
         if (this.m_TreeViewState.columnWidths == null)
         {
             int num = AudioProfilerInfoHelper.GetLastColumnIndex() + 1;
             this.m_TreeViewState.columnWidths = new float[num];
             for (int i = 0; i < num; i++)
             {
                 this.m_TreeViewState.columnWidths[i] = (i < 0x12) ? ((float) 0x37) : ((float) 80);
             }
             this.m_TreeViewState.columnWidths[0] = 200f;
             this.m_TreeViewState.columnWidths[1] = 200f;
             this.m_TreeViewState.columnWidths[2] = 80f;
             this.m_TreeViewState.columnWidths[3] = 80f;
         }
         this.m_TreeView = new TreeView(this.m_EditorWindow, this.m_TreeViewState);
         ITreeViewGUI gui = new AudioProfilerViewGUI(this.m_TreeView);
         ITreeViewDataSource data = new AudioProfilerDataSource(this.m_TreeView, this.m_Backend);
         this.m_TreeView.Init(rect, data, gui, null);
         this.m_ColumnHeader = new AudioProfilerViewColumnHeader(this.m_TreeViewState, this.m_Backend);
         this.m_ColumnHeader.columnWidths = this.m_TreeViewState.columnWidths;
         this.m_ColumnHeader.minColumnWidth = 30f;
         this.m_TreeView.selectionChangedCallback = (Action<int[]>) Delegate.Combine(this.m_TreeView.selectionChangedCallback, new Action<int[]>(this.OnTreeSelectionChanged));
     }
 }
예제 #6
0
        public void Init(Rect rect, AudioProfilerBackend backend)
        {
            if (this.m_HeaderStyle == null)
            {
                this.m_HeaderStyle = new GUIStyle((GUIStyle)"OL title");
            }
            this.m_HeaderStyle.alignment = TextAnchor.MiddleLeft;
            if (this.m_TreeView != null)
            {
                return;
            }
            this.m_Backend = backend;
            if (this.m_TreeViewState.columnWidths == null)
            {
                int length = AudioProfilerInfoHelper.GetLastColumnIndex() + 1;
                this.m_TreeViewState.columnWidths = new float[length];
                for (int index = 2; index < length; ++index)
                {
                    this.m_TreeViewState.columnWidths[index] = index == 2 || index == 3 || index >= 11 && index <= 16 ? 75f : 60f;
                }
                this.m_TreeViewState.columnWidths[0] = 140f;
                this.m_TreeViewState.columnWidths[1] = 140f;
            }
            this.m_TreeView = new TreeView(this.m_EditorWindow, (TreeViewState)this.m_TreeViewState);
            ITreeViewGUI        gui  = (ITreeViewGUI) new AudioProfilerView.AudioProfilerViewGUI(this.m_TreeView);
            ITreeViewDataSource data = (ITreeViewDataSource) new AudioProfilerView.AudioProfilerDataSource(this.m_TreeView, this.m_Backend);

            this.m_TreeView.Init(rect, data, gui, (ITreeViewDragging)null);
            this.m_ColumnHeader = new AudioProfilerView.AudioProfilerViewColumnHeader(this.m_TreeViewState, this.m_Backend);
            this.m_ColumnHeader.columnWidths          = this.m_TreeViewState.columnWidths;
            this.m_ColumnHeader.minColumnWidth        = 30f;
            this.m_TreeView.selectionChangedCallback += new System.Action <int[]>(this.OnTreeSelectionChanged);
        }
예제 #7
0
 public AudioProfilerDataSource(TreeView treeView, AudioProfilerBackend backend) : base(treeView)
 {
     this.m_Backend          = backend;
     this.m_Backend.OnUpdate = new AudioProfilerBackend.DataUpdateDelegate(this.FetchData);
     base.showRootItem       = false;
     base.rootIsCollapsable  = false;
     this.FetchData();
 }
			public AudioProfilerDataSource(TreeView treeView, AudioProfilerBackend backend) : base(treeView)
			{
				this.m_Backend = backend;
				this.m_Backend.OnUpdate = new AudioProfilerBackend.DataUpdateDelegate(this.FetchData);
				base.showRootNode = false;
				base.rootIsCollapsable = false;
				this.FetchData();
			}
예제 #9
0
 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 AudioProfilerViewColumnHeader(AudioProfilerTreeViewState state, AudioProfilerBackend backend)
 {
   this.m_TreeViewState = state;
   this.m_Backend = backend;
   this.minColumnWidth = 10f;
   this.dragWidth = 6f;
 }