
When you select this menu item to call the function and build the AssetBundles, a build dialog with a progress bar appears.

This script creates a menu item at the bottom of the Assets menu. The following script exports AssetBundles: using UnityEditor īuildPipeline.BuildAssetBundles ("Assets/AssetBundles", BuildAssetBundleOptions.None, BuildTarget.StandaloneOSXUniversal) Exporting AssetBundlesĪssetBundles are exported from the editor using script code. The meta file belonging to an Asset has the chosen AssetBundle name written into it. If you create AssetBundles which have no assets assigned to them, you can use the Remove Unused Names option. Using a forward slash in the name of the AssetBundle effectively creates folders so that the menu contains sub-menus, as the screenshot above shows. If you use upper-case characters in the name, they are converted to lower-case. This AssetBundle may contain other assets which have previously been added. In this example the asset has been added to an AssetBundle called environment/desert. Using this menu, you can create one or more AssetBundles, give them names, and then use these new AssetBundle names as the destination for the asset. Then, to add further assets to this bundle, use the menu at the bottom of the Inspector window to select an asset in the Project window and assign it to the named bundle.īy default, the AssetBundle option for assets is set to None, meaning the asset is not written into an AssetBundle but is instead packaged with the main project itself. If you haven’t yet defined a bundle, click New…, and enter a name for your bundle.

Clicking this reveals the names of any currently defined AssetBundles, plus the option to define a new bundle: AssetBundle creation At the very bottom of the Inspector window for that asset is the AssetBundle menu.

To begin creating an AssetBundle (called AssetBundle in scripts and within the Unity Editor), select an asset from your project folder that you want to include in a bundle.
