Esempio n. 1
0
        public static HierarchyProEditorGroupLine Create(HierarchyProGroup group, Rect rect, int indent)
        {
            HierarchyProEditorGroupLine groupLine = new HierarchyProEditorGroupLine(group, rect, indent);

            groupLine.Initialize();
            return(groupLine);
        }
Esempio n. 2
0
        private void DrawAddRemove(Rect right)
        {
            float width = right.width / 2;
            Rect  rect  = new Rect(right)
            {
                x = right.x + width, width = width
            };
            Texture icon     = HierarchyProEditorIcons.Plus;
            Rect    iconRect = rect.GetCenteredIconRect(icon);

            GUI.DrawTexture(iconRect, icon);
            if (GUI.Button(rect, GUIContent.none, GUIStyle.none))
            {
                HierarchyProEditorGroupLine.SelectionAdd(this.Group);
            }

            rect = new Rect(rect)
            {
                x = right.x
            };
            icon     = HierarchyProEditorIcons.Minus;
            iconRect = rect.GetCenteredIconRect(icon);
            GUI.DrawTexture(iconRect, icon);
            if (GUI.Button(rect, GUIContent.none, GUIStyle.none))
            {
                HierarchyProEditorGroupLine.SelectionRemove(this.Group);
            }
        }
        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);
                }
            }
        }