Skip to content

Commit 1cefea1

Browse files
authored
Merge pull request #81 from Unity-Technologies/dev
make the icons actually load despite being in packages.
2 parents 728b1c3 + d6177e8 commit 1cefea1

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77
## [1.5.0] - 2018-02-28
88
- Code static analysis cleanup.
99
- Documentation updates.
10+
- fix to missing bundle-icon bug.
1011

1112
## [1.4.0] - 2018-02-23
1213
- Added a search bar to the main tab. Searches based on asset name.

Editor/AssetBundleModel/ABModel.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -783,14 +783,12 @@ static internal Texture2D GetSceneIcon()
783783
static private void FindBundleIcons()
784784
{
785785
s_folderIcon = EditorGUIUtility.FindTexture("Folder Icon");
786-
string[] icons = AssetDatabase.FindAssets("ABundleBrowserIconY1756");
787-
foreach (string i in icons)
788-
{
789-
string name = AssetDatabase.GUIDToAssetPath(i);
790-
if (name.Contains("ABundleBrowserIconY1756Basic.png"))
791-
s_bundleIcon = (Texture2D)AssetDatabase.LoadAssetAtPath(name, typeof(Texture2D));
792-
else if (name.Contains("ABundleBrowserIconY1756Scene.png"))
793-
s_sceneIcon = (Texture2D)AssetDatabase.LoadAssetAtPath(name, typeof(Texture2D));
786+
787+
var packagePath = System.IO.Path.GetFullPath("Packages/com.unity.assetbundlebrowser");
788+
if (System.IO.Directory.Exists(packagePath))
789+
{
790+
s_bundleIcon = (Texture2D)AssetDatabase.LoadAssetAtPath("Packages/com.unity.assetbundlebrowser/Editor/Icons/ABundleBrowserIconY1756Basic.png", typeof(Texture2D));
791+
s_sceneIcon = (Texture2D)AssetDatabase.LoadAssetAtPath("Packages/com.unity.assetbundlebrowser/Editor/Icons/ABundleBrowserIconY1756Scene.png", typeof(Texture2D));
794792
}
795793
}
796794
}

0 commit comments

Comments
 (0)