Skip to content

Commit

Permalink
Merge pull request #81 from Unity-Technologies/dev
Browse files Browse the repository at this point in the history
make the icons actually load despite being in packages.
  • Loading branch information
alffanclub authored Mar 1, 2018
2 parents 728b1c3 + d6177e8 commit 1cefea1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [1.5.0] - 2018-02-28
- Code static analysis cleanup.
- Documentation updates.
- fix to missing bundle-icon bug.

## [1.4.0] - 2018-02-23
- Added a search bar to the main tab. Searches based on asset name.
Expand Down
14 changes: 6 additions & 8 deletions Editor/AssetBundleModel/ABModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -783,14 +783,12 @@ static internal Texture2D GetSceneIcon()
static private void FindBundleIcons()
{
s_folderIcon = EditorGUIUtility.FindTexture("Folder Icon");
string[] icons = AssetDatabase.FindAssets("ABundleBrowserIconY1756");
foreach (string i in icons)
{
string name = AssetDatabase.GUIDToAssetPath(i);
if (name.Contains("ABundleBrowserIconY1756Basic.png"))
s_bundleIcon = (Texture2D)AssetDatabase.LoadAssetAtPath(name, typeof(Texture2D));
else if (name.Contains("ABundleBrowserIconY1756Scene.png"))
s_sceneIcon = (Texture2D)AssetDatabase.LoadAssetAtPath(name, typeof(Texture2D));

var packagePath = System.IO.Path.GetFullPath("Packages/com.unity.assetbundlebrowser");
if (System.IO.Directory.Exists(packagePath))
{
s_bundleIcon = (Texture2D)AssetDatabase.LoadAssetAtPath("Packages/com.unity.assetbundlebrowser/Editor/Icons/ABundleBrowserIconY1756Basic.png", typeof(Texture2D));
s_sceneIcon = (Texture2D)AssetDatabase.LoadAssetAtPath("Packages/com.unity.assetbundlebrowser/Editor/Icons/ABundleBrowserIconY1756Scene.png", typeof(Texture2D));
}
}
}
Expand Down

0 comments on commit 1cefea1

Please sign in to comment.