Ejemplo n.º 1
0
            private void FillTreeItems(AudioProfilerView.AudioProfilerTreeViewItem parentNode, int depth, int parentId, List <AudioProfilerInfoWrapper> items)
            {
                int capacity = 0;

                foreach (AudioProfilerInfoWrapper wrapper in items)
                {
                    if (parentId == (!wrapper.addToRoot ? wrapper.info.parentId : 0))
                    {
                        capacity++;
                    }
                }
                if (capacity > 0)
                {
                    parentNode.children = new List <TreeViewItem>(capacity);
                    foreach (AudioProfilerInfoWrapper wrapper2 in items)
                    {
                        if (parentId == (!wrapper2.addToRoot ? wrapper2.info.parentId : 0))
                        {
                            AudioProfilerView.AudioProfilerTreeViewItem item = new AudioProfilerView.AudioProfilerTreeViewItem(wrapper2.info.uniqueId, !wrapper2.addToRoot ? depth : 1, parentNode, wrapper2.objectName, wrapper2);
                            parentNode.children.Add(item);
                            this.FillTreeItems(item, depth + 1, wrapper2.info.uniqueId, items);
                        }
                    }
                }
            }
Ejemplo n.º 2
0
            private void FillTreeItems(AudioProfilerView.AudioProfilerTreeViewItem parentNode, int depth, int parentId, List <AudioProfilerInfoWrapper> items)
            {
                int num = 0;

                foreach (AudioProfilerInfoWrapper current in items)
                {
                    if (parentId == ((!current.addToRoot) ? current.info.parentId : 0))
                    {
                        num++;
                    }
                }
                if (num > 0)
                {
                    parentNode.children = new List <TreeViewItem>(num);
                    foreach (AudioProfilerInfoWrapper current2 in items)
                    {
                        if (parentId == ((!current2.addToRoot) ? current2.info.parentId : 0))
                        {
                            AudioProfilerView.AudioProfilerTreeViewItem audioProfilerTreeViewItem = new AudioProfilerView.AudioProfilerTreeViewItem(current2.info.uniqueId, (!current2.addToRoot) ? depth : 1, parentNode, current2.objectName, current2);
                            parentNode.children.Add(audioProfilerTreeViewItem);
                            this.FillTreeItems(audioProfilerTreeViewItem, depth + 1, current2.info.uniqueId, items);
                        }
                    }
                }
            }
Ejemplo n.º 3
0
            private void FillTreeItems(AudioProfilerView.AudioProfilerTreeViewItem parentNode, int depth, int parentId, List <AudioProfilerInfoWrapper> items)
            {
                int capacity = 0;

                using (List <AudioProfilerInfoWrapper> .Enumerator enumerator = items.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        AudioProfilerInfoWrapper current = enumerator.Current;
                        if (parentId == (!current.addToRoot ? current.info.parentId : 0))
                        {
                            ++capacity;
                        }
                    }
                }
                if (capacity <= 0)
                {
                    return;
                }
                parentNode.children = new List <TreeViewItem>(capacity);
                using (List <AudioProfilerInfoWrapper> .Enumerator enumerator = items.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        AudioProfilerInfoWrapper current = enumerator.Current;
                        if (parentId == (!current.addToRoot ? current.info.parentId : 0))
                        {
                            AudioProfilerView.AudioProfilerTreeViewItem parentNode1 = new AudioProfilerView.AudioProfilerTreeViewItem(current.info.uniqueId, !current.addToRoot ? depth : 1, (TreeViewItem)parentNode, current.objectName, current);
                            parentNode.children.Add((TreeViewItem)parentNode1);
                            this.FillTreeItems(parentNode1, depth + 1, current.info.uniqueId, items);
                        }
                    }
                }
            }
Ejemplo n.º 4
0
 public override void FetchData()
 {
     AudioProfilerView.AudioProfilerTreeViewItem audioProfilerTreeViewItem = new AudioProfilerView.AudioProfilerTreeViewItem(1, 0, null, "ROOT", new AudioProfilerInfoWrapper(default(AudioProfilerInfo), "ROOT", "ROOT", false));
     this.FillTreeItems(audioProfilerTreeViewItem, 1, 0, this.m_Backend.items);
     this.m_RootItem = audioProfilerTreeViewItem;
     this.SetExpandedWithChildren(this.m_RootItem, true);
     this.m_NeedRefreshVisibleFolders = true;
 }
Ejemplo n.º 5
0
			public override void FetchData()
			{
				AudioProfilerView.AudioProfilerTreeViewItem audioProfilerTreeViewItem = new AudioProfilerView.AudioProfilerTreeViewItem(1, 0, null, "ROOT", new AudioProfilerInfoWrapper(default(AudioProfilerInfo), "ROOT", "ROOT", false));
				this.FillTreeItems(audioProfilerTreeViewItem, 1, 0, this.m_Backend.items);
				this.m_RootItem = audioProfilerTreeViewItem;
				this.SetExpandedWithChildren(this.m_RootItem, true);
				this.m_NeedRefreshVisibleFolders = true;
			}
Ejemplo n.º 6
0
 public override void FetchData()
 {
     AudioProfilerView.AudioProfilerTreeViewItem parentNode = new AudioProfilerView.AudioProfilerTreeViewItem(1, 0, null, "ROOT", new AudioProfilerInfoWrapper(new AudioProfilerInfo(), "ROOT", "ROOT", false));
     this.FillTreeItems(parentNode, 1, 0, this.m_Backend.items);
     base.m_RootItem = parentNode;
     this.SetExpandedWithChildren(base.m_RootItem, true);
     base.m_NeedRefreshVisibleFolders = true;
 }
Ejemplo n.º 7
0
 public void OnTreeSelectionChanged(int[] selection)
 {
     if (selection.Length == 1)
     {
         TreeViewItem treeViewItem = this.m_TreeView.FindItem(selection[0]);
         AudioProfilerView.AudioProfilerTreeViewItem audioProfilerTreeViewItem = treeViewItem as AudioProfilerView.AudioProfilerTreeViewItem;
         if (audioProfilerTreeViewItem != null)
         {
             EditorGUIUtility.PingObject(audioProfilerTreeViewItem.info.info.assetInstanceId);
             this.delayedPingObject = audioProfilerTreeViewItem.info.info.objectInstanceId;
             EditorApplication.CallDelayed(new EditorApplication.CallbackFunction(this.PingObjectDelayed), 1f);
         }
     }
 }
Ejemplo n.º 8
0
 public void OnTreeSelectionChanged(int[] selection)
 {
     if (selection.Length != 1)
     {
         return;
     }
     AudioProfilerView.AudioProfilerTreeViewItem node = this.m_TreeView.FindNode(selection[0]) as AudioProfilerView.AudioProfilerTreeViewItem;
     if (node == null)
     {
         return;
     }
     EditorGUIUtility.PingObject(node.info.info.assetInstanceId);
     this.delayedPingObject = node.info.info.objectInstanceId;
     EditorApplication.CallDelayed(new EditorApplication.CallbackFunction(this.PingObjectDelayed), 1f);
 }
Ejemplo n.º 9
0
            protected override void DrawIconAndLabel(Rect rect, TreeViewItem item, string label, bool selected, bool focused, bool useBoldFont, bool isPinging)
            {
                GUIStyle gUIStyle = (!useBoldFont) ? TreeViewGUI.s_Styles.lineStyle : TreeViewGUI.s_Styles.lineBoldStyle;

                gUIStyle.alignment    = TextAnchor.MiddleLeft;
                gUIStyle.padding.left = 0;
                base.DrawIconAndLabel(new Rect(rect.x, rect.y, this.columnWidths[0], rect.height), item, label, selected, focused, useBoldFont, isPinging);
                gUIStyle.alignment = TextAnchor.MiddleRight;
                rect.x            += this.columnWidths[0];
                AudioProfilerView.AudioProfilerTreeViewItem audioProfilerTreeViewItem = item as AudioProfilerView.AudioProfilerTreeViewItem;
                for (int i = 1; i < this.columnWidths.Length; i++)
                {
                    rect.width = this.columnWidths[i] - 3f;
                    gUIStyle.Draw(rect, AudioProfilerInfoHelper.GetColumnString(audioProfilerTreeViewItem.info, (AudioProfilerInfoHelper.ColumnIndices)i), false, false, selected, focused);
                    rect.x += this.columnWidths[i];
                }
                gUIStyle.alignment = TextAnchor.MiddleLeft;
            }
Ejemplo n.º 10
0
            protected override void DrawIconAndLabel(Rect rect, TreeViewItem item, string label, bool selected, bool focused, bool useBoldFont, bool isPinging)
            {
                GUIStyle guiStyle = !useBoldFont ? TreeViewGUI.s_Styles.lineStyle : TreeViewGUI.s_Styles.lineBoldStyle;

                guiStyle.alignment    = TextAnchor.MiddleLeft;
                guiStyle.padding.left = 0;
                int num = 2;

                base.DrawIconAndLabel(new Rect(rect.x, rect.y, this.columnWidths[0] - (float)num, rect.height), item, label, selected, focused, useBoldFont, isPinging);
                rect.x += this.columnWidths[0] + (float)num;
                AudioProfilerView.AudioProfilerTreeViewItem profilerTreeViewItem = item as AudioProfilerView.AudioProfilerTreeViewItem;
                for (int index = 1; index < this.columnWidths.Length; ++index)
                {
                    rect.width = this.columnWidths[index] - (float)(2 * num);
                    guiStyle.Draw(rect, AudioProfilerInfoHelper.GetColumnString(profilerTreeViewItem.info, (AudioProfilerInfoHelper.ColumnIndices)index), false, false, selected, focused);
                    Handles.color = Color.black;
                    Handles.DrawLine(new Vector3((float)((double)rect.x - (double)num + 1.0), rect.y, 0.0f), new Vector3((float)((double)rect.x - (double)num + 1.0), rect.y + rect.height, 0.0f));
                    rect.x            += this.columnWidths[index];
                    guiStyle.alignment = TextAnchor.MiddleRight;
                }
                guiStyle.alignment = TextAnchor.MiddleLeft;
            }
Ejemplo n.º 11
0
			private void FillTreeItems(AudioProfilerView.AudioProfilerTreeViewItem parentNode, int depth, int parentId, List<AudioProfilerInfoWrapper> items)
			{
				int num = 0;
				foreach (AudioProfilerInfoWrapper current in items)
				{
					if (parentId == ((!current.addToRoot) ? current.info.parentId : 0))
					{
						num++;
					}
				}
				if (num > 0)
				{
					parentNode.children = new List<TreeViewItem>(num);
					foreach (AudioProfilerInfoWrapper current2 in items)
					{
						if (parentId == ((!current2.addToRoot) ? current2.info.parentId : 0))
						{
							AudioProfilerView.AudioProfilerTreeViewItem audioProfilerTreeViewItem = new AudioProfilerView.AudioProfilerTreeViewItem(current2.info.uniqueId, (!current2.addToRoot) ? depth : 1, parentNode, current2.objectName, current2);
							parentNode.children.Add(audioProfilerTreeViewItem);
							this.FillTreeItems(audioProfilerTreeViewItem, depth + 1, current2.info.uniqueId, items);
						}
					}
				}
			}
 public override void FetchData()
 {
   AudioProfilerView.AudioProfilerTreeViewItem parentNode = new AudioProfilerView.AudioProfilerTreeViewItem(1, 0, (TreeViewItem) null, "ROOT", new AudioProfilerInfoWrapper(new AudioProfilerInfo(), "ROOT", "ROOT", false));
   this.FillTreeItems(parentNode, 1, 0, this.m_Backend.items);
   this.m_RootItem = (TreeViewItem) parentNode;
   this.SetExpandedWithChildren(this.m_RootItem, true);
   this.m_NeedRefreshVisibleFolders = true;
 }
 private void FillTreeItems(AudioProfilerView.AudioProfilerTreeViewItem parentNode, int depth, int parentId, List<AudioProfilerInfoWrapper> items)
 {
   int capacity = 0;
   using (List<AudioProfilerInfoWrapper>.Enumerator enumerator = items.GetEnumerator())
   {
     while (enumerator.MoveNext())
     {
       AudioProfilerInfoWrapper current = enumerator.Current;
       if (parentId == (!current.addToRoot ? current.info.parentId : 0))
         ++capacity;
     }
   }
   if (capacity <= 0)
     return;
   parentNode.children = new List<TreeViewItem>(capacity);
   using (List<AudioProfilerInfoWrapper>.Enumerator enumerator = items.GetEnumerator())
   {
     while (enumerator.MoveNext())
     {
       AudioProfilerInfoWrapper current = enumerator.Current;
       if (parentId == (!current.addToRoot ? current.info.parentId : 0))
       {
         AudioProfilerView.AudioProfilerTreeViewItem parentNode1 = new AudioProfilerView.AudioProfilerTreeViewItem(current.info.uniqueId, !current.addToRoot ? depth : 1, (TreeViewItem) parentNode, current.objectName, current);
         parentNode.children.Add((TreeViewItem) parentNode1);
         this.FillTreeItems(parentNode1, depth + 1, current.info.uniqueId, items);
       }
     }
   }
 }
Ejemplo n.º 14
0
 private void FillTreeItems(AudioProfilerView.AudioProfilerTreeViewItem parentNode, int depth, int parentId, List<AudioProfilerInfoWrapper> items)
 {
     int capacity = 0;
     foreach (AudioProfilerInfoWrapper wrapper in items)
     {
         if (parentId == (!wrapper.addToRoot ? wrapper.info.parentId : 0))
         {
             capacity++;
         }
     }
     if (capacity > 0)
     {
         parentNode.children = new List<TreeViewItem>(capacity);
         foreach (AudioProfilerInfoWrapper wrapper2 in items)
         {
             if (parentId == (!wrapper2.addToRoot ? wrapper2.info.parentId : 0))
             {
                 AudioProfilerView.AudioProfilerTreeViewItem item = new AudioProfilerView.AudioProfilerTreeViewItem(wrapper2.info.uniqueId, !wrapper2.addToRoot ? depth : 1, parentNode, wrapper2.objectName, wrapper2);
                 parentNode.children.Add(item);
                 this.FillTreeItems(item, depth + 1, wrapper2.info.uniqueId, items);
             }
         }
     }
 }