Mark Asset as AssetBundle from script

HI, I’m searching if there is still a way in unity 5.x to create asset bundles from my code, or to mark some assets as asset bundles so I don’t have to manually mark them. I already know the assets, but I can’t convert them…


Ok, I managed to find a solution, using the asset importer class.

You only have to load the asset into an asset importer :

AssetImporter assetImporter = AssetImporter.GetAtPath(“Assets/Resources/” + name + “.asset”);

and then, change the value and save :

assetImporter.SetAssetBundleNameAndVariant(name, “bundle”);

Bye, Fire :slight_smile: