Skip to content

Commit

Permalink
Updating asset bundle browser: Unity-Technologies/AssetBundles-Browse…
Browse files Browse the repository at this point in the history
  • Loading branch information
nievesj committed Jul 9, 2018
1 parent 87a34e8 commit fc3ad70
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Plugins/AssetBundles-Browser/Editor/AssetBundleBuildTab.cs
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,9 @@ private static void DirectoryCopy(string sourceDirName, string destDirName)

foreach (string filePath in Directory.GetFiles(sourceDirName, "*.*", SearchOption.AllDirectories))
{
string newFilePath = Path.Combine(Path.GetDirectoryName(filePath).Replace(sourceDirName, destDirName),
Path.GetFileName(filePath));
var fileDirName = Path.GetDirectoryName(filePath).Replace("\\", "/");
var fileName = Path.GetFileName(filePath);
string newFilePath = Path.Combine(fileDirName.Replace(sourceDirName, destDirName), fileName);

File.Copy(filePath, newFilePath, true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ internal void ForceReloadData()
{
UpdateSelectedBundles(new List<AssetBundleModel.BundleInfo>());
SetSelectedItems(new List<AssetBundleModel.AssetInfo>());
m_BundleTree.SetSelection(new int[0]);
AssetBundleModel.Model.ForceReloadData(m_BundleTree);
m_Parent.Repaint();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using UnityEngine;
using UnityEditor;
using System.Collections.Generic;
using System.Linq;
using UnityEditor.IMGUI.Controls;

namespace AssetBundleBrowser.AssetBundleModel
Expand Down Expand Up @@ -176,7 +177,8 @@ internal MessageType HighestMessageLevel()
if (m_dependencies != null && m_dependencies.Count > 0)
{
var message = string.Empty;
foreach (var dependent in m_dependencies)
var sortedDependencies = m_dependencies.OrderBy(d => d.bundleName);
foreach (var dependent in sortedDependencies)
{
if (dependent.bundleName != bundleName)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,12 @@ internal override void HandleReparent(string parentName, BundleFolderInfo newPar
newName += m_Name.shortName;
if (newName == m_Name.bundleName)
return;

if (newParent != null && newParent.GetChild(newName) != null)
{
Model.LogWarning("An item named '" + newName + "' already exists at this level in hierarchy. If your desire is to merge bundles, drag one on top of the other.");
return;
}

foreach (var asset in m_ConcreteAssets)
{
Expand Down Expand Up @@ -884,6 +890,13 @@ internal override void HandleReparent(string parentName, BundleFolderInfo newPar
newName += displayName;
if (newName == m_Name.bundleName)
return;

if (newParent != null && newParent.GetChild(newName) != null)
{
Model.LogWarning("An item named '" + newName + "' already exists at this level in hierarchy. If your desire is to merge bundles, drag one on top of the other.");
return;
}

foreach (var child in m_Children)
{
child.Value.HandleReparent(newName);
Expand Down Expand Up @@ -966,6 +979,13 @@ internal override void HandleReparent(string parentName, BundleFolderInfo newPar
newName += displayName;
if (newName == m_Name.bundleName)
return;

if (newParent != null && newParent.GetChild(newName) != null)
{
Model.LogWarning("An item named '" + newName + "' already exists at this level in hierarchy. If your desire is to merge bundles, drag one on top of the other.");
return;
}

foreach (var child in m_Children)
{
child.Value.HandleReparent(parentName);
Expand Down

0 comments on commit fc3ad70

Please sign in to comment.