AStarCollisionMap.QuadTree.Quad.GetDepth C# (CSharp) Method

GetDepth() public method

Gets the depth of this node in the tree.
public GetDepth ( ) : int
return int
        public int GetDepth()
        {
            Quad quad = this;
            int depth = 0;
            while (quad.parent != null)
            {
                quad = quad.parent;
                depth++;
            }
            return depth;
        }