ChildCount() public method

public ChildCount ( ) : int
return int
示例#1
0
 protected override void DrawData(Rect rect, MemoryElement memoryElement, int indent, int row, bool selected)
 {
     if (Event.current.type == EventType.Repaint)
     {
         string text = memoryElement.name;
         if (memoryElement.ChildCount() > 0 && indent < 3)
         {
             text = text + " (" + memoryElement.AccumulatedChildCount().ToString() + ")";
         }
         int num = 0;
         rect.xMax = (float)this.m_Splitter.realSizes[num];
         MemoryTreeList.styles.numberLabel.Draw(rect, text, false, false, false, selected);
         rect.x     = rect.xMax;
         rect.width = (float)this.m_Splitter.realSizes[++num] - 4f;
         MemoryTreeList.styles.numberLabel.Draw(rect, EditorUtility.FormatBytes(memoryElement.totalMemory), false, false, false, selected);
         rect.x    += (float)this.m_Splitter.realSizes[num++];
         rect.width = (float)this.m_Splitter.realSizes[num] - 4f;
         if (memoryElement.ReferenceCount() > 0)
         {
             MemoryTreeList.styles.numberLabel.Draw(rect, memoryElement.ReferenceCount().ToString(), false, false, false, selected);
         }
         else if (selected)
         {
             MemoryTreeList.styles.numberLabel.Draw(rect, "", false, false, false, selected);
         }
     }
 }
 protected override void DrawData(Rect rect, MemoryElement memoryElement, int indent, int row, bool selected)
 {
     if (Event.current.type == EventType.Repaint)
     {
         string name = memoryElement.name;
         if ((memoryElement.ChildCount() > 0) && (indent < 3))
         {
             name = name + " (" + memoryElement.AccumulatedChildCount().ToString() + ")";
         }
         int index = 0;
         rect.xMax = base.m_Splitter.realSizes[index];
         MemoryTreeList.styles.numberLabel.Draw(rect, name, false, false, false, selected);
         rect.x = rect.xMax;
         rect.width = base.m_Splitter.realSizes[++index] - 4f;
         MemoryTreeList.styles.numberLabel.Draw(rect, EditorUtility.FormatBytes(memoryElement.totalMemory), false, false, false, selected);
         rect.x += base.m_Splitter.realSizes[index++];
         rect.width = base.m_Splitter.realSizes[index] - 4f;
         if (memoryElement.ReferenceCount() > 0)
         {
             MemoryTreeList.styles.numberLabel.Draw(rect, memoryElement.ReferenceCount().ToString(), false, false, false, selected);
         }
         else if (selected)
         {
             MemoryTreeList.styles.numberLabel.Draw(rect, string.Empty, false, false, false, selected);
         }
     }
 }
示例#3
0
        protected override void DrawData(Rect rect, MemoryElement memoryElement, int indent, int row, bool selected)
        {
            if (Event.current.type != EventType.Repaint)
            {
                return;
            }

            string displayName = memoryElement.name;

            if (memoryElement.ChildCount() > 0 && indent < 3)
            {
                displayName += " (" + memoryElement.AccumulatedChildCount() + ")";
            }

            int currentColumn = 0;

            rect.xMax = m_Splitter.realSizes[currentColumn];
            styles.numberLabel.Draw(rect, displayName, false, false, false, selected);
            rect.x     = rect.xMax;
            rect.width = m_Splitter.realSizes[++currentColumn] - kSmallMargin;
            styles.numberLabel.Draw(rect, EditorUtility.FormatBytes(memoryElement.totalMemory), false, false, false, selected);
            rect.x    += m_Splitter.realSizes[currentColumn++];
            rect.width = m_Splitter.realSizes[currentColumn] - kSmallMargin;

            if (memoryElement.ReferenceCount() > 0)
            {
                styles.numberLabel.Draw(rect, memoryElement.ReferenceCount().ToString(), false, false, false, selected);
            }
            else if (selected)
            {
                styles.numberLabel.Draw(rect, "", false, false, false, selected);
            }
        }
示例#4
0
 protected override void DrawData(Rect rect, MemoryElement memoryElement, int indent, int row, bool selected)
 {
     if (Event.current.type == EventType.Repaint)
     {
         string name = memoryElement.name;
         if ((memoryElement.ChildCount() > 0) && (indent < 3))
         {
             name = name + " (" + memoryElement.AccumulatedChildCount().ToString() + ")";
         }
         int index = 0;
         rect.xMax = base.m_Splitter.realSizes[index];
         MemoryTreeList.styles.numberLabel.Draw(rect, name, false, false, false, selected);
         rect.x     = rect.xMax;
         rect.width = base.m_Splitter.realSizes[++index] - 4f;
         MemoryTreeList.styles.numberLabel.Draw(rect, EditorUtility.FormatBytes(memoryElement.totalMemory), false, false, false, selected);
         rect.x    += base.m_Splitter.realSizes[index++];
         rect.width = base.m_Splitter.realSizes[index] - 4f;
         if (memoryElement.ReferenceCount() > 0)
         {
             MemoryTreeList.styles.numberLabel.Draw(rect, memoryElement.ReferenceCount().ToString(), false, false, false, selected);
         }
         else if (selected)
         {
             MemoryTreeList.styles.numberLabel.Draw(rect, string.Empty, false, false, false, selected);
         }
     }
 }
示例#5
0
        protected virtual void DrawItem(MemoryElement memoryElement, ref int row, int indent)
        {
            bool flag = this.m_MemorySelection.isSelected(memoryElement);

            MemoryTreeList.DrawBackground(row, flag);
            Rect rect = MemoryTreeList.GenerateRect(row);

            rect.x = 4f + (float)indent * 16f - 14f;
            Rect position = rect;

            position.width = 14f;
            if (memoryElement.ChildCount() > 0)
            {
                memoryElement.expanded = GUI.Toggle(position, memoryElement.expanded, GUIContent.none, MemoryTreeList.styles.foldout);
            }
            rect.x += 14f;
            if (flag)
            {
                this.m_SelectionOffset = (float)row * 16f;
            }
            if (Event.current.type == EventType.MouseDown && rect.Contains(Event.current.mousePosition))
            {
                this.RowClicked(Event.current, memoryElement);
            }
            this.DrawData(rect, memoryElement, indent, row, flag);
            if (memoryElement.expanded)
            {
                this.DrawRecursiveData(memoryElement, ref row, indent + 1);
            }
        }
 protected virtual void DrawItem(MemoryElement memoryElement, ref int row, int indent)
 {
     bool selected = this.m_MemorySelection.isSelected(memoryElement);
     DrawBackground(row, selected);
     Rect rect = GenerateRect(row);
     rect.x = (4f + (indent * 16f)) - 14f;
     Rect position = rect;
     position.width = 14f;
     if (memoryElement.ChildCount() > 0)
     {
         memoryElement.expanded = GUI.Toggle(position, memoryElement.expanded, GUIContent.none, styles.foldout);
     }
     rect.x += 14f;
     if (selected)
     {
         this.m_SelectionOffset = ((float) row) * 16f;
     }
     if ((Event.current.type == EventType.MouseDown) && rect.Contains(Event.current.mousePosition))
     {
         this.RowClicked(Event.current, memoryElement);
     }
     this.DrawData(rect, memoryElement, indent, row, selected);
     if (memoryElement.expanded)
     {
         this.DrawRecursiveData(memoryElement, ref row, indent + 1);
     }
 }
示例#7
0
 protected void DrawRecursiveData(MemoryElement element, ref int row, int indent)
 {
     if (element.ChildCount() != 0)
     {
         element.ExpandChildren();
         foreach (MemoryElement current in element.children)
         {
             row++;
             this.DrawItem(current, ref row, indent);
         }
     }
 }
示例#8
0
        protected void DrawRecursiveData(MemoryElement element, ref int row, int indent)
        {
            if (element.ChildCount() == 0)
            {
                return;
            }

            element.ExpandChildren();
            foreach (MemoryElement elem in element.children)
            {
                row++;
                DrawItem(elem, ref row, indent);
            }
        }
        protected override void DrawData(Rect rect, MemoryElement memoryElement, int indent, int row, bool selected)
        {
            if (Event.current.type != EventType.Repaint)
            {
                return;
            }
            string text = memoryElement.name;

            if (memoryElement.ChildCount() > 0 && indent < 3)
            {
                text = text + " (" + memoryElement.AccumulatedChildCount().ToString() + ")";
            }
            int index1 = 0;

            rect.xMax = (float)this.m_Splitter.realSizes[index1];
            MemoryTreeList.styles.numberLabel.Draw(rect, text, false, false, false, selected);
            rect.x = rect.xMax;
            int num1;

            rect.width = (float)this.m_Splitter.realSizes[num1 = index1 + 1] - 4f;
            MemoryTreeList.styles.numberLabel.Draw(rect, EditorUtility.FormatBytes(memoryElement.totalMemory), false, false, false, selected);
            // ISSUE: explicit reference operation
            // ISSUE: variable of a reference type
            Rect& local = @rect;
            // ISSUE: explicit reference operation
            double x = (double)(^ local).x;

            int[]  realSizes = this.m_Splitter.realSizes;
            int    index2    = num1;
            int    num2      = 1;
            int    index3    = index2 + num2;
            double num3      = (double)realSizes[index2];
            double num4      = x + num3;

            // ISSUE: explicit reference operation
            (^ local).x = (float)num4;
            rect.width  = (float)this.m_Splitter.realSizes[index3] - 4f;
            if (memoryElement.ReferenceCount() > 0)
            {
                MemoryTreeList.styles.numberLabel.Draw(rect, memoryElement.ReferenceCount().ToString(), false, false, false, selected);
            }
            else
            {
                if (!selected)
                {
                    return;
                }
                MemoryTreeList.styles.numberLabel.Draw(rect, string.Empty, false, false, false, selected);
            }
        }
示例#10
0
 private void RecursiveFindSelected(MemoryElement element, ref int row)
 {
     if (this.m_MemorySelection.isSelected(element))
     {
         this.m_SelectionOffset = (float)row * 16f;
     }
     row++;
     if (element.expanded && element.ChildCount() != 0)
     {
         element.ExpandChildren();
         foreach (MemoryElement current in element.children)
         {
             this.RecursiveFindSelected(current, ref row);
         }
     }
 }
示例#11
0
 protected void DrawRecursiveData(MemoryElement element, ref int row, int indent)
 {
     if (element.ChildCount() == 0)
     {
         return;
     }
     element.ExpandChildren();
     using (List <MemoryElement> .Enumerator enumerator = element.children.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             MemoryElement current = enumerator.Current;
             row = row + 1;
             this.DrawItem(current, ref row, indent);
         }
     }
 }
示例#12
0
        private void RecursiveFindSelected(MemoryElement element, ref int row)
        {
            if (m_MemorySelection.isSelected(element))
            {
                m_SelectionOffset = row * kRowHeight;
            }
            row++;

            if (!element.expanded || element.ChildCount() == 0)
            {
                return;
            }

            element.ExpandChildren();

            foreach (MemoryElement elem in element.children)
            {
                RecursiveFindSelected(elem, ref row);
            }
        }
示例#13
0
 private void RecursiveFindSelected(MemoryElement element, ref int row)
 {
     if (this.m_MemorySelection.isSelected(element))
     {
         this.m_SelectionOffset = (float)row * 16f;
     }
     row = row + 1;
     if (!element.expanded || element.ChildCount() == 0)
     {
         return;
     }
     element.ExpandChildren();
     using (List <MemoryElement> .Enumerator enumerator = element.children.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             this.RecursiveFindSelected(enumerator.Current, ref row);
         }
     }
 }
 protected override void DrawData(Rect rect, MemoryElement memoryElement, int indent, int row, bool selected)
 {
   if (Event.current.type != EventType.Repaint)
     return;
   string text = memoryElement.name;
   if (memoryElement.ChildCount() > 0 && indent < 3)
     text = text + " (" + memoryElement.AccumulatedChildCount().ToString() + ")";
   int index1 = 0;
   rect.xMax = (float) this.m_Splitter.realSizes[index1];
   MemoryTreeList.styles.numberLabel.Draw(rect, text, false, false, false, selected);
   rect.x = rect.xMax;
   int num1;
   rect.width = (float) this.m_Splitter.realSizes[num1 = index1 + 1] - 4f;
   MemoryTreeList.styles.numberLabel.Draw(rect, EditorUtility.FormatBytes(memoryElement.totalMemory), false, false, false, selected);
   // ISSUE: explicit reference operation
   // ISSUE: variable of a reference type
   Rect& local = @rect;
   // ISSUE: explicit reference operation
   double x = (double) (^local).x;
   int[] realSizes = this.m_Splitter.realSizes;
   int index2 = num1;
   int num2 = 1;
   int index3 = index2 + num2;
   double num3 = (double) realSizes[index2];
   double num4 = x + num3;
   // ISSUE: explicit reference operation
   (^local).x = (float) num4;
   rect.width = (float) this.m_Splitter.realSizes[index3] - 4f;
   if (memoryElement.ReferenceCount() > 0)
   {
     MemoryTreeList.styles.numberLabel.Draw(rect, memoryElement.ReferenceCount().ToString(), false, false, false, selected);
   }
   else
   {
     if (!selected)
       return;
     MemoryTreeList.styles.numberLabel.Draw(rect, string.Empty, false, false, false, selected);
   }
 }
示例#15
0
        protected virtual void DrawItem(MemoryElement memoryElement, ref int row, int indent)
        {
            bool isSelected = m_MemorySelection.isSelected(memoryElement);

            DrawBackground(row, isSelected);

            Rect rect = GenerateRect(row);

            rect.x = kBaseIndent + indent * kIndentPx - kFoldoutSize;
            Rect toggleRect = rect;

            toggleRect.width = kFoldoutSize;
            if (memoryElement.ChildCount() > 0)
            {
                memoryElement.expanded = GUI.Toggle(toggleRect, memoryElement.expanded, GUIContent.none, styles.foldout);
            }

            rect.x += kFoldoutSize;

            if (isSelected)
            {
                m_SelectionOffset = row * kRowHeight;
            }

            if (Event.current.type == EventType.MouseDown && rect.Contains(Event.current.mousePosition))
            {
                RowClicked(Event.current, memoryElement);
            }

            DrawData(rect, memoryElement, indent, row, isSelected);

            if (memoryElement.expanded)
            {
                DrawRecursiveData(memoryElement, ref row, indent + 1);
            }
        }
示例#16
0
 private void RecursiveFindSelected(MemoryElement element, ref int row)
 {
     if (this.m_MemorySelection.isSelected(element))
     {
         this.m_SelectionOffset = ((float) row) * 16f;
     }
     row++;
     if (element.expanded && (element.ChildCount() != 0))
     {
         element.ExpandChildren();
         foreach (MemoryElement element2 in element.children)
         {
             this.RecursiveFindSelected(element2, ref row);
         }
     }
 }
 protected void DrawRecursiveData(MemoryElement element, ref int row, int indent)
 {
   if (element.ChildCount() == 0)
     return;
   element.ExpandChildren();
   using (List<MemoryElement>.Enumerator enumerator = element.children.GetEnumerator())
   {
     while (enumerator.MoveNext())
     {
       MemoryElement current = enumerator.Current;
       row = row + 1;
       this.DrawItem(current, ref row, indent);
     }
   }
 }
 protected virtual void DrawItem(MemoryElement memoryElement, ref int row, int indent)
 {
   bool selected = this.m_MemorySelection.isSelected(memoryElement);
   MemoryTreeList.DrawBackground(row, selected);
   Rect rect = MemoryTreeList.GenerateRect(row);
   rect.x = (float) (4.0 + (double) indent * 16.0 - 14.0);
   Rect position = rect;
   position.width = 14f;
   if (memoryElement.ChildCount() > 0)
     memoryElement.expanded = GUI.Toggle(position, memoryElement.expanded, GUIContent.none, MemoryTreeList.styles.foldout);
   rect.x += 14f;
   if (selected)
     this.m_SelectionOffset = (float) row * 16f;
   if (Event.current.type == EventType.MouseDown && rect.Contains(Event.current.mousePosition))
     this.RowClicked(Event.current, memoryElement);
   this.DrawData(rect, memoryElement, indent, row, selected);
   if (!memoryElement.expanded)
     return;
   this.DrawRecursiveData(memoryElement, ref row, indent + 1);
 }
 private void RecursiveFindSelected(MemoryElement element, ref int row)
 {
   if (this.m_MemorySelection.isSelected(element))
     this.m_SelectionOffset = (float) row * 16f;
   row = row + 1;
   if (!element.expanded || element.ChildCount() == 0)
     return;
   element.ExpandChildren();
   using (List<MemoryElement>.Enumerator enumerator = element.children.GetEnumerator())
   {
     while (enumerator.MoveNext())
       this.RecursiveFindSelected(enumerator.Current, ref row);
   }
 }
示例#20
0
		private void RecursiveFindSelected(MemoryElement element, ref int row)
		{
			if (this.m_MemorySelection.isSelected(element))
			{
				this.m_SelectionOffset = (float)row * 16f;
			}
			row++;
			if (!element.expanded || element.ChildCount() == 0)
			{
				return;
			}
			element.ExpandChildren();
			foreach (MemoryElement current in element.children)
			{
				this.RecursiveFindSelected(current, ref row);
			}
		}
示例#21
0
 protected void DrawRecursiveData(MemoryElement element, ref int row, int indent)
 {
     if (element.ChildCount() != 0)
     {
         element.ExpandChildren();
         foreach (MemoryElement element2 in element.children)
         {
             row++;
             this.DrawItem(element2, ref row, indent);
         }
     }
 }