protected override void DrawIconAndLabel(Rect rect, TreeViewItem itemRaw, string label, bool selected, bool focused, bool useBoldFont, bool isPinging)
            {
                FrameDebuggerTreeView.FDTreeViewItem fdTreeViewItem = (FrameDebuggerTreeView.FDTreeViewItem)itemRaw;
                float contentIndent = this.GetContentIndent((TreeViewItem)fdTreeViewItem);

                rect.x     += contentIndent;
                rect.width -= contentIndent;
                if (fdTreeViewItem.m_ChildEventCount > 0)
                {
                    Rect position = rect;
                    position.width -= 4f;
                    GUIContent content      = EditorGUIUtility.TempContent(fdTreeViewItem.m_ChildEventCount.ToString((IFormatProvider)CultureInfo.InvariantCulture));
                    GUIStyle   rowTextRight = FrameDebuggerWindow.styles.rowTextRight;
                    rowTextRight.Draw(position, content, false, false, false, false);
                    rect.width -= rowTextRight.CalcSize(content).x + 8f;
                }
                string t = fdTreeViewItem.id > 0 ? FrameDebuggerWindow.s_FrameEventTypeNames[(int)fdTreeViewItem.m_FrameEvent.type] + fdTreeViewItem.displayName : fdTreeViewItem.displayName;

                if (string.IsNullOrEmpty(t))
                {
                    t = "<unknown scope>";
                }
                GUIContent content1 = EditorGUIUtility.TempContent(t);

                FrameDebuggerWindow.styles.rowText.Draw(rect, content1, false, false, false, selected && focused);
            }
Esempio n. 2
0
 protected override void OnContentGUI(Rect rect, int row, TreeViewItem itemRaw, string label, bool selected, bool focused, bool useBoldFont, bool isPinging)
 {
     if (Event.current.type == EventType.Repaint)
     {
         string     displayName;
         GUIContent content;
         FrameDebuggerTreeView.FDTreeViewItem item = (FrameDebuggerTreeView.FDTreeViewItem)itemRaw;
         float contentIndent = this.GetContentIndent(item);
         rect.x     += contentIndent;
         rect.width -= contentIndent;
         if (item.m_ChildEventCount > 0)
         {
             Rect position = rect;
             position.width -= 4f;
             content         = EditorGUIUtility.TempContent(item.m_ChildEventCount.ToString(CultureInfo.InvariantCulture));
             GUIStyle rowTextRight = FrameDebuggerWindow.styles.rowTextRight;
             rowTextRight.Draw(position, content, false, false, false, false);
             rect.width -= rowTextRight.CalcSize(content).x + 8f;
         }
         if (item.id <= 0)
         {
             displayName = item.displayName;
         }
         else
         {
             displayName = FrameDebuggerWindow.s_FrameEventTypeNames[(int)item.m_FrameEvent.type] + item.displayName;
         }
         if (string.IsNullOrEmpty(displayName))
         {
             displayName = "<unknown scope>";
         }
         content = EditorGUIUtility.TempContent(displayName);
         FrameDebuggerWindow.styles.rowText.Draw(rect, content, false, false, false, selected && focused);
     }
 }
Esempio n. 3
0
            public override void FetchData()
            {
                FDTreeHierarchyLevel        level      = new FDTreeHierarchyLevel(0, 0, string.Empty, null);
                List <FDTreeHierarchyLevel> eventStack = new List <FDTreeHierarchyLevel> {
                    level
                };
                int num = -1;

                for (int i = 0; i < this.m_FrameEvents.Length; i++)
                {
                    string frameEventInfoName = FrameDebuggerUtility.GetFrameEventInfoName(i);
                    if (frameEventInfoName == null)
                    {
                    }
                    char[]   separator = new char[] { '/' };
                    string[] strArray  = ("/" + string.Empty).Split(separator);
                    int      index     = 0;
                    while ((index < eventStack.Count) && (index < strArray.Length))
                    {
                        if (strArray[index] != eventStack[index].item.displayName)
                        {
                            break;
                        }
                        index++;
                    }
                    while ((eventStack.Count > 0) && (eventStack.Count > index))
                    {
                        CloseLastHierarchyLevel(eventStack, i);
                    }
                    for (int j = index; j < strArray.Length; j++)
                    {
                        FDTreeHierarchyLevel level2 = eventStack[eventStack.Count - 1];
                        FDTreeHierarchyLevel level3 = new FDTreeHierarchyLevel(eventStack.Count - 1, --num, strArray[j], level2.item);
                        level2.children.Add(level3.item);
                        eventStack.Add(level3);
                    }
                    GameObject           frameEventGameObject = FrameDebuggerUtility.GetFrameEventGameObject(i);
                    string               displayName          = (frameEventGameObject == null) ? string.Empty : (" " + frameEventGameObject.name);
                    FDTreeHierarchyLevel level4 = eventStack[eventStack.Count - 1];
                    int id = i + 1;
                    FrameDebuggerTreeView.FDTreeViewItem item = new FrameDebuggerTreeView.FDTreeViewItem(id, eventStack.Count - 1, level4.item, displayName)
                    {
                        m_FrameEvent = this.m_FrameEvents[i]
                    };
                    level4.children.Add(item);
                    level4.item.m_ChildEventCount++;
                }
                while (eventStack.Count > 0)
                {
                    CloseLastHierarchyLevel(eventStack, this.m_FrameEvents.Length);
                }
                base.m_RootItem = level.item;
            }
Esempio n. 4
0
            private static void CloseLastHierarchyLevel(List <FDTreeHierarchyLevel> eventStack, int prevFrameEventIndex)
            {
                int index = eventStack.Count - 1;

                eventStack[index].item.children     = eventStack[index].children;
                eventStack[index].item.m_EventIndex = prevFrameEventIndex;
                if (eventStack[index].item.parent != null)
                {
                    FrameDebuggerTreeView.FDTreeViewItem parent = (FrameDebuggerTreeView.FDTreeViewItem)eventStack[index].item.parent;
                    parent.m_ChildEventCount += eventStack[index].item.m_ChildEventCount;
                }
                eventStack.RemoveAt(index);
            }
            public override void FetchData()
            {
                FrameDebuggerTreeView.FDTreeViewDataSource.FDTreeHierarchyLevel        fDTreeHierarchyLevel = new FrameDebuggerTreeView.FDTreeViewDataSource.FDTreeHierarchyLevel(0, 0, string.Empty, null);
                List <FrameDebuggerTreeView.FDTreeViewDataSource.FDTreeHierarchyLevel> list = new List <FrameDebuggerTreeView.FDTreeViewDataSource.FDTreeHierarchyLevel>();

                list.Add(fDTreeHierarchyLevel);
                int num = -1;

                for (int i = 0; i < this.m_FrameEvents.Length; i++)
                {
                    string   text  = "/" + (FrameDebuggerUtility.GetFrameEventInfoName(i) ?? string.Empty);
                    string[] array = text.Split(new char[]
                    {
                        '/'
                    });
                    int num2 = 0;
                    while (num2 < list.Count && num2 < array.Length)
                    {
                        if (array[num2] != list[num2].item.displayName)
                        {
                            break;
                        }
                        num2++;
                    }
                    while (list.Count > 0 && list.Count > num2)
                    {
                        FrameDebuggerTreeView.FDTreeViewDataSource.CloseLastHierarchyLevel(list, i);
                    }
                    for (int j = num2; j < array.Length; j++)
                    {
                        FrameDebuggerTreeView.FDTreeViewDataSource.FDTreeHierarchyLevel fDTreeHierarchyLevel2 = list[list.Count - 1];
                        FrameDebuggerTreeView.FDTreeViewDataSource.FDTreeHierarchyLevel fDTreeHierarchyLevel3 = new FrameDebuggerTreeView.FDTreeViewDataSource.FDTreeHierarchyLevel(list.Count - 1, --num, array[j], fDTreeHierarchyLevel2.item);
                        fDTreeHierarchyLevel2.children.Add(fDTreeHierarchyLevel3.item);
                        list.Add(fDTreeHierarchyLevel3);
                    }
                    GameObject frameEventGameObject = FrameDebuggerUtility.GetFrameEventGameObject(i);
                    string     displayName          = (!frameEventGameObject) ? string.Empty : (" " + frameEventGameObject.name);
                    FrameDebuggerTreeView.FDTreeViewDataSource.FDTreeHierarchyLevel fDTreeHierarchyLevel4 = list[list.Count - 1];
                    int id = i + 1;
                    FrameDebuggerTreeView.FDTreeViewItem fDTreeViewItem = new FrameDebuggerTreeView.FDTreeViewItem(id, list.Count - 1, fDTreeHierarchyLevel4.item, displayName);
                    fDTreeViewItem.m_FrameEvent = this.m_FrameEvents[i];
                    fDTreeHierarchyLevel4.children.Add(fDTreeViewItem);
                    fDTreeHierarchyLevel4.item.m_ChildEventCount++;
                }
                while (list.Count > 0)
                {
                    FrameDebuggerTreeView.FDTreeViewDataSource.CloseLastHierarchyLevel(list, this.m_FrameEvents.Length);
                }
                this.m_RootItem = fDTreeHierarchyLevel.item;
            }
 public void SelectFrameEventIndex(int eventIndex)
 {
     int[] selection = this.m_TreeView.GetSelection();
     if (selection.Length > 0)
     {
         FrameDebuggerTreeView.FDTreeViewItem node = this.m_TreeView.FindNode(selection[0]) as FrameDebuggerTreeView.FDTreeViewItem;
         if (node != null && eventIndex == node.m_EventIndex)
         {
             return;
         }
     }
     this.m_TreeView.SetSelection(new int[1] {
         eventIndex
     }, 1 != 0);
 }
 public void SelectFrameEventIndex(int eventIndex)
 {
     int[] selection = this.m_TreeView.GetSelection();
     if (selection.Length > 0)
     {
         FrameDebuggerTreeView.FDTreeViewItem fDTreeViewItem = this.m_TreeView.FindItem(selection[0]) as FrameDebuggerTreeView.FDTreeViewItem;
         if (fDTreeViewItem != null && eventIndex == fDTreeViewItem.m_EventIndex)
         {
             return;
         }
     }
     this.m_TreeView.SetSelection(new int[]
     {
         eventIndex
     }, true);
 }
 private void SelectionChanged(int[] selectedIDs)
 {
     if (selectedIDs.Length >= 1)
     {
         int num  = selectedIDs[0];
         int num2 = num;
         if (num2 <= 0)
         {
             FrameDebuggerTreeView.FDTreeViewItem fDTreeViewItem = this.m_TreeView.FindItem(num) as FrameDebuggerTreeView.FDTreeViewItem;
             if (fDTreeViewItem != null)
             {
                 num2 = fDTreeViewItem.m_EventIndex;
             }
         }
         if (num2 > 0)
         {
             this.m_FrameDebugger.ChangeFrameEventLimit(num2);
         }
     }
 }
        private void SelectionChanged(int[] selectedIDs)
        {
            if (selectedIDs.Length < 1)
            {
                return;
            }
            int selectedId = selectedIDs[0];
            int newLimit   = selectedId;

            if (newLimit <= 0)
            {
                FrameDebuggerTreeView.FDTreeViewItem node = this.m_TreeView.FindNode(selectedId) as FrameDebuggerTreeView.FDTreeViewItem;
                if (node != null)
                {
                    newLimit = node.m_EventIndex;
                }
            }
            if (newLimit <= 0)
            {
                return;
            }
            this.m_FrameDebugger.ChangeFrameEventLimit(newLimit);
        }
Esempio n. 10
0
            protected override void DrawIconAndLabel(Rect rect, TreeViewItem itemRaw, string label, bool selected, bool focused, bool useBoldFont, bool isPinging)
            {
                FrameDebuggerTreeView.FDTreeViewItem fDTreeViewItem = (FrameDebuggerTreeView.FDTreeViewItem)itemRaw;
                float contentIndent = this.GetContentIndent(fDTreeViewItem);

                rect.x     += contentIndent;
                rect.width -= contentIndent;
                string     text;
                GUIContent content;
                GUIStyle   gUIStyle;

                if (fDTreeViewItem.m_ChildEventCount > 0)
                {
                    Rect position = rect;
                    position.width -= 4f;
                    text            = fDTreeViewItem.m_ChildEventCount.ToString(CultureInfo.InvariantCulture);
                    content         = EditorGUIUtility.TempContent(text);
                    gUIStyle        = FrameDebuggerWindow.styles.rowTextRight;
                    gUIStyle.Draw(position, content, false, false, false, false);
                    rect.width -= gUIStyle.CalcSize(content).x + 8f;
                }
                if (fDTreeViewItem.id <= 0)
                {
                    text = fDTreeViewItem.displayName;
                }
                else
                {
                    text = FrameDebuggerWindow.s_FrameEventTypeNames[(int)fDTreeViewItem.m_FrameEvent.type] + fDTreeViewItem.displayName;
                }
                if (string.IsNullOrEmpty(text))
                {
                    text = "<unknown scope>";
                }
                content  = EditorGUIUtility.TempContent(text);
                gUIStyle = FrameDebuggerWindow.styles.rowText;
                gUIStyle.Draw(rect, content, false, false, false, selected && focused);
            }
 internal FDTreeHierarchyLevel(int depth, int id, string name, FrameDebuggerTreeView.FDTreeViewItem parent)
 {
     this.item     = new FrameDebuggerTreeView.FDTreeViewItem(id, depth, parent, name);
     this.children = new List <TreeViewItem>();
 }
 public FDTreeViewItem(int id, int depth, FrameDebuggerTreeView.FDTreeViewItem parent, string displayName) : base(id, depth, parent, displayName)
 {
     this.m_EventIndex = id;
 }
 internal FDTreeHierarchyLevel(int depth, int id, string name, FrameDebuggerTreeView.FDTreeViewItem parent)
 {
   this.item = new FrameDebuggerTreeView.FDTreeViewItem(id, depth, parent, name);
   this.children = new List<TreeViewItem>();
 }
Esempio n. 14
0
 public override void FetchData()
 {
     FDTreeHierarchyLevel level = new FDTreeHierarchyLevel(0, 0, string.Empty, null);
     List<FDTreeHierarchyLevel> eventStack = new List<FDTreeHierarchyLevel> {
         level
     };
     int num = -1;
     for (int i = 0; i < this.m_FrameEvents.Length; i++)
     {
         string frameEventInfoName = FrameDebuggerUtility.GetFrameEventInfoName(i);
         if (frameEventInfoName == null)
         {
         }
         char[] separator = new char[] { '/' };
         string[] strArray = ("/" + string.Empty).Split(separator);
         int index = 0;
         while ((index < eventStack.Count) && (index < strArray.Length))
         {
             if (strArray[index] != eventStack[index].item.displayName)
             {
                 break;
             }
             index++;
         }
         while ((eventStack.Count > 0) && (eventStack.Count > index))
         {
             CloseLastHierarchyLevel(eventStack, i);
         }
         for (int j = index; j < strArray.Length; j++)
         {
             FDTreeHierarchyLevel level2 = eventStack[eventStack.Count - 1];
             FDTreeHierarchyLevel level3 = new FDTreeHierarchyLevel(eventStack.Count - 1, --num, strArray[j], level2.item);
             level2.children.Add(level3.item);
             eventStack.Add(level3);
         }
         GameObject gameObjectForEvent = FrameDebuggerWindow.GetGameObjectForEvent(i);
         string displayName = (gameObjectForEvent == null) ? string.Empty : (" " + gameObjectForEvent.name);
         FDTreeHierarchyLevel level4 = eventStack[eventStack.Count - 1];
         int id = i + 1;
         FrameDebuggerTreeView.FDTreeViewItem item = new FrameDebuggerTreeView.FDTreeViewItem(id, eventStack.Count - 1, level4.item, displayName) {
             m_FrameEvent = this.m_FrameEvents[i]
         };
         level4.children.Add(item);
         level4.item.m_ChildEventCount++;
     }
     while (eventStack.Count > 0)
     {
         CloseLastHierarchyLevel(eventStack, this.m_FrameEvents.Length);
     }
     base.m_RootItem = level.item;
 }
			public override void FetchData()
			{
				FrameDebuggerTreeView.FDTreeViewDataSource.FDTreeHierarchyLevel fDTreeHierarchyLevel = new FrameDebuggerTreeView.FDTreeViewDataSource.FDTreeHierarchyLevel(0, 0, string.Empty, null);
				List<FrameDebuggerTreeView.FDTreeViewDataSource.FDTreeHierarchyLevel> list = new List<FrameDebuggerTreeView.FDTreeViewDataSource.FDTreeHierarchyLevel>();
				list.Add(fDTreeHierarchyLevel);
				int num = -1;
				for (int i = 0; i < this.m_FrameEvents.Length; i++)
				{
					string text = "/" + (FrameDebuggerUtility.GetFrameEventInfoName(i) ?? string.Empty);
					string[] array = text.Split(new char[]
					{
						'/'
					});
					int num2 = 0;
					while (num2 < list.Count && num2 < array.Length)
					{
						if (array[num2] != list[num2].item.displayName)
						{
							break;
						}
						num2++;
					}
					while (list.Count > 0 && list.Count > num2)
					{
						FrameDebuggerTreeView.FDTreeViewDataSource.CloseLastHierarchyLevel(list, i);
					}
					for (int j = num2; j < array.Length; j++)
					{
						FrameDebuggerTreeView.FDTreeViewDataSource.FDTreeHierarchyLevel fDTreeHierarchyLevel2 = list[list.Count - 1];
						FrameDebuggerTreeView.FDTreeViewDataSource.FDTreeHierarchyLevel fDTreeHierarchyLevel3 = new FrameDebuggerTreeView.FDTreeViewDataSource.FDTreeHierarchyLevel(list.Count - 1, --num, array[j], fDTreeHierarchyLevel2.item);
						fDTreeHierarchyLevel2.children.Add(fDTreeHierarchyLevel3.item);
						list.Add(fDTreeHierarchyLevel3);
					}
					GameObject gameObjectForEvent = FrameDebuggerWindow.GetGameObjectForEvent(i);
					string displayName = (!gameObjectForEvent) ? string.Empty : (" " + gameObjectForEvent.name);
					FrameDebuggerTreeView.FDTreeViewDataSource.FDTreeHierarchyLevel fDTreeHierarchyLevel4 = list[list.Count - 1];
					int id = i + 1;
					FrameDebuggerTreeView.FDTreeViewItem fDTreeViewItem = new FrameDebuggerTreeView.FDTreeViewItem(id, list.Count - 1, fDTreeHierarchyLevel4.item, displayName);
					fDTreeViewItem.m_FrameEvent = this.m_FrameEvents[i];
					fDTreeHierarchyLevel4.children.Add(fDTreeViewItem);
					fDTreeHierarchyLevel4.item.m_ChildEventCount++;
				}
				while (list.Count > 0)
				{
					FrameDebuggerTreeView.FDTreeViewDataSource.CloseLastHierarchyLevel(list, this.m_FrameEvents.Length);
				}
				this.m_RootItem = fDTreeHierarchyLevel.item;
			}