Пример #1
0
        protected override TreeViewItem BuildRoot()
        {
            var result = new GroupTreeViewItem();

            if (m_controller.GroupModel != null)
            {
                foreach (var groupName in m_controller.GroupModel.Keys)
                {
                    result.AddChild(new GroupTreeViewItem(groupName, m_controller.GroupModel[groupName]));
                }
            }
            else
            {
                result.AddChild(new GroupTreeViewItem("", null));
            }

            return(result);
        }
Пример #2
0
        private void CellGUI(Rect cellRect, TreeViewItem item, int column, ref RowGUIArgs args)
        {
            GroupTreeViewItem groupItem = item as GroupTreeViewItem;

            if (groupItem == null)
            {
                return;
            }

            switch (column)
            {
            case 0:
                DefaultGUI.Label(cellRect, groupItem.name, args.selected, args.focused);
                break;

            case 1:
                DefaultGUI.Label(cellRect, groupItem.items.ToString(), args.selected, args.focused);
                break;

            case 2:
                DefaultGUI.Label(cellRect, EditorUtility.FormatBytes(groupItem.fileSize), args.selected, args.focused);
                break;
            }
        }