


This takes all the Assets you labeled with an AssetBundle name and places them in a folder at the path assetBundleDirectory defines. When you click Build AssetBundles a progress bar appears with a build dialog. This script creates a menu item at the bottom of the Assets menu called Build AssetBundles that executes the code in the function associated with that tag. If(!Directory.Exists(assetBundleDirectory))ĭirectory.CreateDirectory(assetBundleDirectory) īuildPipeline.BuildAssetBundles(assetBundleDirectory, String assetBundleDirectory = "Assets/AssetBundles" Build the AssetBundlesĬreate a folder called Editor in the Assets folders, and place a script with the following contents in the folder: using UnityEditor To read more information on AssetBundle assignments and accompanying strategies, see documentation on Preparing Assets for AssetBundles. The AssetBundle assignments for individual Assets takes precedence, however. By default, all Assets in that folder are assigned to the same AssetBundle as the folder. Note: In the Inspector you can assign an AssetBundle to a folder in your Project. Variant names are not required to build the AssetBundles


Select the Asset you want to assign to a bundle from your Project View.To assign a given Asset to an AssetBundle, follow these steps: A recommended, and more user friendly, alternative is to use the Addressables package. Note: This section describes the creation of AssetBundles using the built-in BuildPipeline.BuildAssetBundles() API. More detailed information about each piece of the workflow can be found in the other pages in this section of documentation. To get started with AssetBundles, follow these steps.
