Exemple #1
0
        public static AssetTreeItem CreateAssetListTreeView(IEnumerable <AssetBundleModel.BundleInfo> selectedBundles)
        {
            //m_bundlesToUpdate.AddRange(selectedBundles);
            var root = new AssetTreeItem();

            if (selectedBundles != null)
            {
                foreach (var bundle in selectedBundles)
                {
                    bundle.AddAssetsToNode(root);
                }
            }
            return(root);
        }
        public override void AddAssetsToNode(AssetTreeItem node)
        {
            foreach (var asset in m_concreteAssets)
            {
                node.AddChild(new AssetTreeItem(asset));
            }

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

            m_dirty = false;
        }
Exemple #3
0
        private void CellGUI(Rect cellRect, AssetBundleModel.AssetTreeItem item, int column, ref RowGUIArgs args)
        {
            CenterRectUsingSingleLineHeight(ref cellRect);
            GUI.color = item.ItemColor;
            switch (column)
            {
            case 0:
            {
                var iconRect = new Rect(cellRect.x + 1, cellRect.y + 1, cellRect.height - 2, cellRect.height - 2);
                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.asset.BundleName, args.selected, args.focused);
                break;

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

            case 3:
                var icon = AssetBundleModel.ProblemMessage.GetIcon(item.HighestMessageLevel());
                if (icon != null)
                {
                    //var iconRect = new Rect(cellRect.x + 1, cellRect.y + 1, cellRect.height - 2, cellRect.height - 2);
                    var iconRect = new Rect(cellRect.x, cellRect.y, cellRect.height, cellRect.height);
                    GUI.DrawTexture(iconRect, icon, ScaleMode.ScaleToFit);
                }
                break;
            }
        }
 abstract public void AddAssetsToNode(AssetTreeItem node);