Skip to content

Commit

Permalink
Merge pull request #8 from Unity-Technologies/dev
Browse files Browse the repository at this point in the history
expand bundle details and minor tweaks.
  • Loading branch information
alffanclub authored May 4, 2017
2 parents 926686b + 9f5be57 commit e16c8ad
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ internal class AssetBundleTree : TreeView
{
AssetBundleManageTab m_Controller;
private bool m_ContextOnItem = false;
List<UnityEngine.Object> m_EmptyObjectList = new List<Object>();

public AssetBundleTree(TreeViewState state, AssetBundleManageTab ctrl) : base(state)
{
Expand Down Expand Up @@ -489,7 +490,7 @@ protected override void SetupDragAndDrop(SetupDragAndDropArgs args)
selectedBundles.Add(item.bundle);
}
DragAndDrop.paths = null;
DragAndDrop.objectReferences = new UnityEngine.Object[] { };
DragAndDrop.objectReferences = m_EmptyObjectList.ToArray();
DragAndDrop.SetGenericData("AssetBundleModel.BundleInfo", selectedBundles);
DragAndDrop.visualMode = DragAndDropVisualMode.Copy;//Move;
DragAndDrop.StartDrag("AssetBundleTree");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ internal class AssetListTree : TreeView
{
List<AssetBundleModel.BundleInfo> m_SourceBundles = new List<AssetBundleModel.BundleInfo>();
AssetBundleManageTab m_Controller;
List<UnityEngine.Object> m_EmptyObjectList = new List<Object>();

public static MultiColumnHeaderState CreateDefaultMultiColumnHeaderState()
{
Expand Down Expand Up @@ -201,7 +202,11 @@ protected override void SelectionChanged(IList<int> selectedIds)
}
m_Controller.SetSelectedItems(selectedAssets);
}

protected override bool CanBeParent(TreeViewItem item)
{
return false;
}

protected override bool CanStartDrag(CanStartDragArgs args)
{
args.draggedItemIDs = GetSelection();
Expand All @@ -211,10 +216,10 @@ protected override bool CanStartDrag(CanStartDragArgs args)
protected override void SetupDragAndDrop(SetupDragAndDropArgs args)
{
DragAndDrop.PrepareStartDrag();
DragAndDrop.objectReferences = m_EmptyObjectList.ToArray();
List<AssetBundleModel.AssetTreeItem> items =
new List<AssetBundleModel.AssetTreeItem>(args.draggedItemIDs.Select(id => FindItem(id, rootItem) as AssetBundleModel.AssetTreeItem));
DragAndDrop.paths = items.Select(a => a.asset.fullAssetName).ToArray();
DragAndDrop.objectReferences = new UnityEngine.Object[] { };
DragAndDrop.SetGenericData("AssetListTreeSource", this);
DragAndDrop.StartDrag("AssetListTree");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ public void Update()
dirty |= bundle.dirty;
}
if (dirty)
{
Reload();
ExpandAll();
}
}
protected override TreeViewItem BuildRoot()
{
Expand Down Expand Up @@ -149,6 +152,7 @@ internal void SetItems(IEnumerable<AssetBundleModel.BundleInfo> items)
}
SetSelection(new List<int>());
Reload();
ExpandAll();
}
internal void CollectBundles(AssetBundleModel.BundleInfo bundle)
{
Expand Down

0 comments on commit e16c8ad

Please sign in to comment.