

The error seems to imply to me that my approach is slightly incorrect, maybe in setting up the AssetBundleBuild it is making a duplicate asset bundle containing all the contents of the original with an identical name.UAAE is an advanced editor for Unity. Many thanks in advance for your help and suggestions. If(!Directory.Exists(assetBundleOutputDirectory))ĭirectory.CreateDirectory(assetBundleOutputDirectory) īuildPipeline.BuildAssetBundles(assetBundleOutputDirectory, new AssetBundleBuild, BuildAssetBundleOptions.None, BuildTarget)

Path.Combine(assetBundleOutputDirectory, assetBundleToBuild.assetBundleVariant) If (string.IsNullOrWhiteSpace(assetBundleToBuild.assetBundleVariant)) String assetBundleOutputDirectory = Path.Combine(AssetBundleRootDirectory, assetBundleToBuild.assetBundleName) Put the bundles in a folder within the Assets directory. Static void BuildAnAssetBundle(AssetBundleBuild assetBundleToBuild) If(!String.IsNullOrWhiteSpace(assetBundle.assetBundleName))ĭebug.Log("Asset bundle building finished.") ProcessedBundles.Add(assetBundleFullName) ĪssetBundleBuild build = new AssetBundleBuild() īuild.assetBundleVariant = assetBundleVariant īuild.assetNames = AssetDatabase.GetAssetPathsFromAssetBundle(assetBundleFullName) įoreach (var assetBundle in assetBundleBuilds.ToArray()) If (processedBundles.Contains(assetBundleFullName)) Only process assetBundleFullName once. Var assetBundleFullName = string.IsNullOrEmpty(assetBundleVariant) ? assetBundleName : assetBundleName + "." + assetBundleVariant Var assetBundleVariant = importer.assetBundleVariant Var assetBundleName = importer.assetBundleName Var importer = AssetImporter.GetAtPath(assetPath) HashSet processedBundles = new HashSet() Var assets = AssetDatabase.GetAllAssetPaths().ToArray()

Public static void BuildBundlesIntoDirectories()ĭebug.Log("Asset bundle building started.") Private const BuildTarget BuildTarget = Private const string AssetBundleRootDirectory = "Assets/BuiltAssetBundles" What do I need to do to make this work, please? public class BuildAssetBundles : MonoBehaviour Manifest AssetBundle name "example_bundle_name" has conflict with the user predefined AssetBundle name.

The issue is that I am getting the following error: I feel I am quite close in that I have got a list of all the asset bundles in the project, set up directories for them, and tried to build them. This led me to produce the following script (see below). I have familiarised myself to some degree with the AssetBundleBuild and BuildPipeline classes. In other words, given AssetBundles named "A" and "B", the out put would be two folders where "A" contains the built bundled assets which were labelled for inclusion in "A", and likewise a similar folder for "B". My project contains multiple AssetBundles, and I want to be able to click a button in the Editor which builds all AssetBundles out into their own appropriately named folders.
