[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());
}
}
Unity Editor输出预设的BundleName
最新推荐文章于 2024-04-03 15:46:39 发布