Skip to content

Instantly share code, notes, and snippets.

@twobob
Last active December 28, 2015 02:50
Show Gist options
  • Save twobob/0391e67f2825ec024337 to your computer and use it in GitHub Desktop.
Save twobob/0391e67f2825ec024337 to your computer and use it in GitHub Desktop.
Simple helper Editor method to list out all known asset bundles and their bundle-names.
using UnityEngine;
using UnityEditor;
using System.Collections;
public class ListBundles : MonoBehaviour
{
[MenuItem("Assets/AssetBundles/List AssetBundles %#l")]
static void List()
{
Debug.Log("<color=#ffff00ff>Search Initialising</color>, Please be patient");
string assetPath = string.Empty;
string bundleName = string.Empty;
foreach (var assetGuid in AssetDatabase.FindAssets(""))
{
assetPath = AssetDatabase.GUIDToAssetPath(assetGuid);
bundleName = AssetImporter.GetAtPath(assetPath).assetBundleName;
if (string.IsNullOrEmpty(bundleName))
{
continue;
}
Debug.Log("Found asset: (GUID:<color=#00ffffff>" + assetGuid + "</color>) " + assetPath + ", AssetBundle: " + bundleName);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment