Ejemplo n.º 1
0
        protected override TreeViewItem BuildRoot()
        {
            var root = new AssetBundleState.AssetInfo.TreeItem();

            root.children = new List <TreeViewItem>();

            if (m_selecteditems != null)
            {
                int index = 0;
                foreach (var a in m_selecteditems)
                {
                    var item = new AssetBundleState.AssetInfo.TreeItem(a, 0, a.m_name);
                    root.AddChild(item);
                    var refs = new List <AssetBundleState.AssetInfo>();
                    a.GatherReferences(refs);
                    if (refs.Count > 0)
                    {
                        var refItem = new TreeViewItem(index++, 1, refs.Count + " reference" + (refs.Count == 1 ? "" : "s"));
                        refItem.icon = Utilities.FoldlerIcon;
                        item.AddChild(refItem);

                        foreach (var d in refs)
                        {
                            refItem.AddChild(new AssetBundleState.AssetInfo.TreeItem(d, 2, d.m_name));
                        }
                    }

                    var bundles = new List <AssetBundleState.BundleInfo>();
                    a.GatherBundles(bundles);
                    if (bundles.Count > 0)
                    {
                        var refItem = new TreeViewItem(index++, 1, bundles.Count + " bundle" + (bundles.Count == 1 ? "" : "s"));
                        refItem.icon = Utilities.FoldlerIcon;
                        item.AddChild(refItem);

                        foreach (var d in bundles)
                        {
                            refItem.AddChild(new AssetBundleState.BundleInfo.TreeItem(d, 2));
                        }
                    }
                }
            }
            return(root);
        }
Ejemplo n.º 2
0
        protected override TreeViewItem BuildRoot()
        {
            var root = new AssetBundleState.AssetInfo.TreeItem();

            root.children = new List <TreeViewItem>();
            if (m_data != null)
            {
                foreach (var a in m_data.m_assets)
                {
                    root.AddChild(new AssetBundleState.AssetInfo.TreeItem(a, 0, Color.white));
                }

                foreach (var a in m_data.m_extendedAssets)
                {
                    root.AddChild(new AssetBundleState.AssetInfo.TreeItem(a, 0, greyColor));
                }
            }
            return(root);
        }
Ejemplo n.º 3
0
        private void CellGUI(Rect cellRect, AssetBundleState.AssetInfo.TreeItem item, int column, ref RowGUIArgs args)
        {
            CenterRectUsingSingleLineHeight(ref cellRect);
            GUI.color = item.color;
            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.m_bundle == null ? string.Empty : item.asset.m_bundle.m_name, args.selected, args.focused);
                break;

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