Skip to content

Commit 9f5be57

Browse files
committed
expand bundle details and minor tweaks.
1 parent 926686b commit 9f5be57

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

UnityEngine.AssetBundles/Editor/AssetBundleBrowser/AssetBundleTree.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ internal class AssetBundleTree : TreeView
1212
{
1313
AssetBundleManageTab m_Controller;
1414
private bool m_ContextOnItem = false;
15+
List<UnityEngine.Object> m_EmptyObjectList = new List<Object>();
1516

1617
public AssetBundleTree(TreeViewState state, AssetBundleManageTab ctrl) : base(state)
1718
{
@@ -489,7 +490,7 @@ protected override void SetupDragAndDrop(SetupDragAndDropArgs args)
489490
selectedBundles.Add(item.bundle);
490491
}
491492
DragAndDrop.paths = null;
492-
DragAndDrop.objectReferences = new UnityEngine.Object[] { };
493+
DragAndDrop.objectReferences = m_EmptyObjectList.ToArray();
493494
DragAndDrop.SetGenericData("AssetBundleModel.BundleInfo", selectedBundles);
494495
DragAndDrop.visualMode = DragAndDropVisualMode.Copy;//Move;
495496
DragAndDrop.StartDrag("AssetBundleTree");

UnityEngine.AssetBundles/Editor/AssetBundleBrowser/AssetListTree.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ internal class AssetListTree : TreeView
1212
{
1313
List<AssetBundleModel.BundleInfo> m_SourceBundles = new List<AssetBundleModel.BundleInfo>();
1414
AssetBundleManageTab m_Controller;
15+
List<UnityEngine.Object> m_EmptyObjectList = new List<Object>();
1516

1617
public static MultiColumnHeaderState CreateDefaultMultiColumnHeaderState()
1718
{
@@ -201,7 +202,11 @@ protected override void SelectionChanged(IList<int> selectedIds)
201202
}
202203
m_Controller.SetSelectedItems(selectedAssets);
203204
}
204-
205+
protected override bool CanBeParent(TreeViewItem item)
206+
{
207+
return false;
208+
}
209+
205210
protected override bool CanStartDrag(CanStartDragArgs args)
206211
{
207212
args.draggedItemIDs = GetSelection();
@@ -211,10 +216,10 @@ protected override bool CanStartDrag(CanStartDragArgs args)
211216
protected override void SetupDragAndDrop(SetupDragAndDropArgs args)
212217
{
213218
DragAndDrop.PrepareStartDrag();
219+
DragAndDrop.objectReferences = m_EmptyObjectList.ToArray();
214220
List<AssetBundleModel.AssetTreeItem> items =
215221
new List<AssetBundleModel.AssetTreeItem>(args.draggedItemIDs.Select(id => FindItem(id, rootItem) as AssetBundleModel.AssetTreeItem));
216222
DragAndDrop.paths = items.Select(a => a.asset.fullAssetName).ToArray();
217-
DragAndDrop.objectReferences = new UnityEngine.Object[] { };
218223
DragAndDrop.SetGenericData("AssetListTreeSource", this);
219224
DragAndDrop.StartDrag("AssetListTree");
220225
}

UnityEngine.AssetBundles/Editor/AssetBundleBrowser/BundleDetailList.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ public void Update()
4444
dirty |= bundle.dirty;
4545
}
4646
if (dirty)
47+
{
4748
Reload();
49+
ExpandAll();
50+
}
4851
}
4952
protected override TreeViewItem BuildRoot()
5053
{
@@ -149,6 +152,7 @@ internal void SetItems(IEnumerable<AssetBundleModel.BundleInfo> items)
149152
}
150153
SetSelection(new List<int>());
151154
Reload();
155+
ExpandAll();
152156
}
153157
internal void CollectBundles(AssetBundleModel.BundleInfo bundle)
154158
{

0 commit comments

Comments
 (0)