private static IEnumerable <HierarchyProEditorGroupLine> StackGroups(Rect rect)
        {
            Rect lineRect = new Rect(rect)
            {
                height = 16
            };
            List <HierarchyProEditorGroupLine> lines = new List <HierarchyProEditorGroupLine>();

            foreach (HierarchyProGroup group in HierarchyProGroupLibrary.RootGroups)
            {
                HierarchyProEditorGroupWindow.StackGroupsRecursive(ref lines, ref lineRect, group);
            }
            return(lines);
        }
        private static void StackGroupsRecursive(ref List <HierarchyProEditorGroupLine> lines, ref Rect lineRect, HierarchyProGroup group, int indent = 0)
        {
            lines.Add(HierarchyProEditorGroupLine.Create(group, lineRect, indent));
            lineRect.y += lineRect.height;

            if (group.ShowChildren)
            {
                IEnumerable <HierarchyProGroup> children = HierarchyProGroupLibrary.FindChildren(group).ToList();
                group.HasChildren = children.Any();
                foreach (HierarchyProGroup child in children)
                {
                    HierarchyProEditorGroupWindow.StackGroupsRecursive(ref lines, ref lineRect, child, indent + 1);
                }
            }
        }