UnityEditor.MemoryElement.GetChildIndexInList C# (CSharp) Method

GetChildIndexInList() public method

public GetChildIndexInList ( ) : int
return int
        public int GetChildIndexInList()
        {
            for (int i = 0; i < this.parent.children.Count; i++)
            {
                if (this.parent.children[i] == this)
                {
                    return i;
                }
            }
            return this.parent.children.Count;
        }

Usage Example

コード例 #1
0
        public MemoryElement GetNextNode()
        {
            MemoryElement result;

            if (this.expanded && this.children.Count > 0)
            {
                result = this.children[0];
            }
            else
            {
                int num = this.GetChildIndexInList() + 1;
                if (num < this.parent.children.Count)
                {
                    result = this.parent.children[num];
                }
                else
                {
                    MemoryElement memoryElement = this.parent;
                    while (memoryElement.parent != null)
                    {
                        int num2 = memoryElement.GetChildIndexInList() + 1;
                        if (num2 < memoryElement.parent.children.Count)
                        {
                            result = memoryElement.parent.children[num2];
                            return(result);
                        }
                        memoryElement = memoryElement.parent;
                    }
                    result = null;
                }
            }
            return(result);
        }
All Usage Examples Of UnityEditor.MemoryElement::GetChildIndexInList