概要
using UnityEditor;
public static class Example
{
[MenuItem( "Tools/アセットバンドル名全削除" )]
private static void Hoge()
{
AssetDatabase.StartAssetEditing();
foreach ( var assetPath in AssetDatabase.GetAllAssetPaths() )
{
var assetImporter = AssetImporter.GetAtPath( assetPath );
if ( string.IsNullOrWhiteSpace( assetImporter.assetBundleName ) ) continue;
assetImporter.SetAssetBundleNameAndVariant( null, null );
assetImporter.SaveAndReimport();
}
AssetDatabase.StopAssetEditing();
foreach ( var n in AssetDatabase.GetAllAssetBundleNames() )
{
AssetDatabase.RemoveAssetBundleName( n, true );
}
AssetDatabase.SaveAssets();
}
}