Legacy Documentation: Version 4.6(go to latest)
Language: English
  • C#
  • JS
  • Boo

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

BuildPipeline.BuildAssetBundleExplicitAssetNames

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public static function BuildAssetBundleExplicitAssetNames(assets: Object[], assetNames: string[], pathName: string, assetBundleOptions: BuildAssetBundleOptions = BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets, targetPlatform: BuildTarget = BuildTarget.WebPlayer): bool;
public static bool BuildAssetBundleExplicitAssetNames(Object[] assets, string[] assetNames, string pathName, BuildAssetBundleOptions assetBundleOptions = BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets, BuildTarget targetPlatform = BuildTarget.WebPlayer);
public static def BuildAssetBundleExplicitAssetNames(assets as Object[], assetNames as string[], pathName as string, assetBundleOptions as BuildAssetBundleOptions = BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets, targetPlatform as BuildTarget = BuildTarget.WebPlayer) as bool
public static function BuildAssetBundleExplicitAssetNames(assets: Object[], assetNames: string[], pathName: string, crc: uint, assetBundleOptions: BuildAssetBundleOptions = BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets, targetPlatform: BuildTarget = BuildTarget.WebPlayer): bool;
public static bool BuildAssetBundleExplicitAssetNames(Object[] assets, string[] assetNames, string pathName, uint crc, BuildAssetBundleOptions assetBundleOptions = BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets, BuildTarget targetPlatform = BuildTarget.WebPlayer);
public static def BuildAssetBundleExplicitAssetNames(assets as Object[], assetNames as string[], pathName as string, crc as uint, assetBundleOptions as BuildAssetBundleOptions = BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets, targetPlatform as BuildTarget = BuildTarget.WebPlayer) as bool

Description

Builds an asset bundle, with custom names for the assets (Unity Pro only).

Creates a compressed unity3d file that contains a collection of assets. AssetBundles can contain any asset found in the project folder.

In the assetNames parameter, supply an array of strings of the same size as the number of assets. These will be used as asset names, which you can then pass to AssetBundle.Load to load a specific asset. Use BuildAssetBundle to just use the asset's path names instead.

The compressed asset bundle file will be saved at pathName. crc allows you to automatically include dependencies or always include complete assets instead of just the exact referenced objects. The optional crc output parameter can be used to get a CRC checksum for the generated AssetBundle, which can be used to verify content when downloading AssetBundles using WWW.LoadFromCacheOrDownload.

The function returns a boolean value which is true if the build succeeded and false otherwise.

See Also: BuildAssetBundle, AssetBundle class, WWW.assetBundle.