Пример #1
0
        internal static AssetTreeViewItem CreateAssetListTreeView(IEnumerable <AssetBundleInfo> selectedBundles)
        {
            var root = new AssetTreeViewItem();

            if (selectedBundles != null)
            {
                foreach (var bundle in selectedBundles)
                {
                    bundle.AddAssetsToNode(root);
                }
            }
            return(root);
        }
Пример #2
0
        internal override void AddAssetsToNode(AssetTreeViewItem node)
        {
            foreach (var asset in m_ConcreteAssets)
            {
                node.AddChild(new AssetTreeViewItem(asset));
            }

            foreach (var asset in m_DependentAssets)
            {
                if (!node.ContainsChild(asset))
                {
                    node.AddChild(new AssetTreeViewItem(asset));
                }
            }

            m_Dirty = false;
        }
        private void CellGUI(Rect cellRect, Model.AssetTreeViewItem item, int column, ref RowGUIArgs args)
        {
            Color oldColor = GUI.color;

            CenterRectUsingSingleLineHeight(ref cellRect);
            if (column != 3)
            {
                GUI.color = item.itemColor;
            }

            switch (column)
            {
            case 0:
            {
                var iconRect = new Rect(cellRect.x + 1, cellRect.y + 1, cellRect.height - 2, cellRect.height - 2);
                if (item.icon != null)
                {
                    GUI.DrawTexture(iconRect, item.icon, ScaleMode.ScaleToFit);
                }
                DefaultGUI.Label(
                    new Rect(cellRect.x + iconRect.xMax + 1, cellRect.y, cellRect.width - iconRect.width, cellRect.height),
                    item.displayName,
                    args.selected,
                    args.focused);
            }
            break;

            case 1:
                DefaultGUI.Label(cellRect, item.assetInfo.bundleName, args.selected, args.focused);
                break;

            case 2:
                DefaultGUI.Label(cellRect, item.assetInfo.GetSizeString(), args.selected, args.focused);
                break;

            case 3:
                var icon = item.MessageIcon();
                if (icon != null)
                {
                    var iconRect = new Rect(cellRect.x, cellRect.y, cellRect.height, cellRect.height);
                    GUI.DrawTexture(iconRect, icon, ScaleMode.ScaleToFit);
                }
                break;
            }
            GUI.color = oldColor;
        }
Пример #4
0
 abstract internal void AddAssetsToNode(AssetTreeViewItem node);