static function PopAssetDependencies () : void
Description
Lets you manage cross-references and dependencies between different asset bundles and player builds.
If a asset bundle has dependencies to other asset bundles, it is your responsibility to make sure the dependent asset bundles are loaded through the WWW class.
When you push asset dependencies it will share all resources on that layer, pushing recursively always inherits the previous dependencies.
PushAssetDependencies and PopAssetDependencies must even each other out.
@
MenuItem(
"Assets/Auto Build Asset Bundles")
static function ExportResource () {
BuildPipeline.PushAssetDependencies();
var options =
BuildAssetBundleOptions.CollectDependencies |
BuildAssetBundleOptions.CompleteAssets;
BuildPipeline.BuildAssetBundle(
AssetDatabase.LoadMainAssetAtPath(
"assets/artwork/lerpzuv.tif"),
null,
"Shared.unity3d", options);
BuildPipeline.PushAssetDependencies();
BuildPipeline.BuildAssetBundle(
AssetDatabase.LoadMainAssetAtPath(
"Assets/Artwork/Lerpz.fbx"),
null,
"Lerpz.unity3d", options);
BuildPipeline.PopAssetDependencies();
BuildPipeline.PushAssetDependencies();
BuildPipeline.BuildAssetBundle(
AssetDatabase.LoadMainAssetAtPath(
"Assets/Artwork/explosive guitex.prefab"),
null,
"explosive.unity3d", options);
BuildPipeline.PopAssetDependencies();
BuildPipeline.PushAssetDependencies();
BuildPipeline.BuildPlayer(
[
"Assets/AdditiveScene.unity"],
"AdditiveScene.unity3d",
BuildTarget.WebPlayer,
BuildOptions.BuildAdditionalStreamedScenes);
BuildPipeline.PopAssetDependencies();
BuildPipeline.PopAssetDependencies();
}
See Also: PushAssetDependencies, BuildAssetBundle.