[MenuItem("Assets/预设的BundleName")]
public static void BundleNameNames()
{
Object[] objs = Selection.objects;
if (objs != null && objs.Length > 0)
{
AssetBundleBuild[] assetBundles = new AssetBundleBuild[objs.Length];
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < objs.Length; i++)
{
string path = AssetDatabase.GetAssetPath(objs[i]);
AssetImporter asset = AssetImporter.GetAtPath(path);
if (!asset) continue;
stringBuilder.Append('"');
stringBuilder.Append(asset.assetBundleName);
stringBuilder.Append('"');
stringBuilder.Append(",");
stringBuilder.Append("\n");
}
Debug.LogError(stringBuilder.ToString());
}
}