Example #1
0
 internal override void AddAssetsToNode(AssetTreeItem node)
 {
     foreach (var child in m_Children)
     {
         child.Value.AddAssetsToNode(node);
     }
     m_Dirty = false;
 }
Example #2
0
        private void CellGUI(Rect cellRect, AssetBundleModel.AssetTreeItem item, int column, ref RowGUIArgs args)
        {
            Color oldColor = GUI.color;

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

            switch (column)
            {
            case (int)SortOption.Asset:
            {
                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 (int)SortOption.Bundle:
                DefaultGUI.Label(cellRect, item.asset.bundleName, args.selected, args.focused);
                break;

            case (int)SortOption.AssetType:
            {
                string tempType = item.asset.assetType.ToString();
                tempType = tempType.Substring(tempType.LastIndexOf('.') + 1);
                DefaultGUI.Label(cellRect, tempType, args.selected, args.focused);
            }
            break;

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

            case (int)SortOption.Message:
                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;

            case (int)SortOption.USize:
                DefaultGUI.Label(cellRect, item.asset.GetUSizeString(), args.selected, args.focused);
                break;
            }
            GUI.color = oldColor;
        }
Example #3
0
        private void CellGUI(Rect cellRect, AssetBundleModel.AssetTreeItem 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.asset.bundleName, args.selected, args.focused);
                break;

            case 2:
                DefaultGUI.Label(cellRect, item.asset.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;

            case 4:
                if (item.asset.isSameName)
                {
                    DefaultGUI.Label(cellRect, "同名", args.selected, args.focused);
                }
                else
                {
                    DefaultGUI.Label(cellRect, "", args.selected, args.focused);
                }
                break;
            }
            GUI.color = oldColor;
        }
        internal 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;
        }
        internal static AssetTreeItem CreateAssetListTreeView(IEnumerable <AssetBundleModel.BundleInfo> selectedBundles)
        {
            var root = new AssetTreeItem();

            if (selectedBundles != null)
            {
                foreach (var bundle in selectedBundles)
                {
                    bundle.AddAssetsToNode(root);
                }
            }
            return(root);
        }
 abstract internal void AddAssetsToNode(AssetTreeItem node);