internal override void AddAssetsToNode(AssetTreeItem node) { foreach (var child in m_Children) { child.Value.AddAssetsToNode(node); } m_Dirty = false; }
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; } 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); } } if (s_bBundleChanged) { OnBundleChanged?.Invoke(); s_bBundleChanged = false; } return(root); }
protected override bool CanStartDrag(CanStartDragArgs args) { IList <int> selectedNodes = GetSelection(); if (!IsDepsBundle()) { foreach (var nodeID in selectedNodes) { AssetBundleModel.AssetTreeItem item = FindItem(nodeID, rootItem) as AssetBundleModel.AssetTreeItem; if (!string.IsNullOrEmpty(item.asset.realBundleName)) { return(false); } } } args.draggedItemIDs = selectedNodes; return(true); }
abstract internal void AddAssetsToNode(AssetTreeItem node);