找回密碼
 注冊帳號

掃一掃,訪問微社區

buildpipeline.popassetdependencies 彈出資源依賴

2015-1-3 22:47| 發布者: 楊炎| 查看: 2953| 評論: 0|原作者: 蠻牛|來自: unity3d腳本manual

摘要: buildpipeline.popassetdependencies 彈出資源依賴static functionpopassetdependencies() : voiddescription描述lets you manage cross-references and dependencies between different asset bundles and player b ...

buildpipeline.popassetdependencies 彈出資源依賴

static functionpopassetdependencies() : 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 thewwwclass.

如果一個資源包與另外的資源包存在依賴關系, 你必須確定依賴的資源包通過www類加載

when you push asset dependencies it will share all resources on that layer, pushing recursively always inherits the previous dependencies.pushassetdependenciesandpopassetdependenciesmust even each other out.

當你使資源具有依賴屬性, 它將在層上共享所有資源, 推入遞歸總是繼承以前的依賴性關系。pushassetdependencies和popassetdependencies必須相互依賴。

@menuitem("assets/auto build asset bundles")

static function exportresource () {

// enable cross-references for all following asset bundles files until

// we call popassetdependencies

//啟用交叉引用,用于所有跟隨的資源包文件,直到我們調用popassetdependencies

buildpipeline.pushassetdependencies();

var options =

buildassetbundleoptions.collectdependencies|

buildassetbundleoptions.completeassets;

// all subsequent resources share assets in this asset bundles

// it is up to you to ensure that the shared asset bundle is

// loaded prior to loading other resources

//所有后續資源將共享這一資源包中的內容,由你來確保共享的資源包是否在其他資源載入之前載入

buildpipeline.buildassetbundle(

assetdatabase.loadmainassetatpath("assets/artwork/lerpzuv.tif"),

null, "shared.unity3d", options);

// by pushing and popping around the asset bundle, this file

// will share resources but later asset bundles will not share assets in this resource

//通過推入和彈出資源包,這個文件將共享這些資源,但是后續的資源包將無法繼續共享它

buildpipeline.pushassetdependencies();

buildpipeline.buildassetbundle(

assetdatabase.loadmainassetatpath("assets/artwork/lerpz.fbx"),

null, "lerpz.unity3d", options);

buildpipeline.popassetdependencies();

// by pushing and popping around the asset bundle, this file

// will share resources but later asset bundles will not share assets in this resource

//通過推入和彈出資源包,這個文件將共享這些資源,但是后續的資源包將無法繼續共享它

buildpipeline.pushassetdependencies();

buildpipeline.buildassetbundle(

assetdatabase.loadmainassetatpath("assets/artwork/explosive guitex.prefab"),

null, "explosive.unity3d", options);

buildpipeline.popassetdependencies();

// by pushing and popping around the asset bundle, this file

// will share resources but later asset bundles will not share assets in this resource

//通過推入和彈出資源包,這個文件將共享這些資源,但是后續的資源包將無法繼續共享它

buildpipeline.pushassetdependencies();

buildpipeline.buildplayer(

["assets/additivescene.unity"], "additivescene.unity3d",

buildtarget.webplayer, buildoptions.buildadditionalstreamedscenes);

buildpipeline.popassetdependencies();

buildpipeline.popassetdependencies();

}

參見:popassetdependencies,buildassetbundle.

相關閱讀

文章點評
相關文章
女校游泳队彩金