彩票巫师排列三17287期:buildpipeline.buildstreamedsceneassetbundle 编译流场景资源包

排列三2014079期正版藏机图 www.d0po.cn 2015-1-3 22:27| 发布者: 杨炎| 查看: 3279| 评论: 0|原作者: 蛮牛|来自: unity3d脚本manual

摘要: buildpipeline.buildstreamedsceneassetbundle 编译流场景资源包static functionbuildstreamedsceneassetbundle(levels: string,locationpath:string,target:buildtarget) :stringdescription描述builds one or more ...

buildpipeline.buildstreamedsceneassetbundle" target="_blank" class="relatedlink">assetbundle 编译流场景资源

static functionbuildstreamedsceneassetbundle(levels: string[],locationpath:string,target:buildtarget) :string

description描述

builds one or more scenes and all it's dependencies into a compressed asset bundle.

编译一个或多个场景和所有它依赖的压缩资源包。

the scene assetbundle can be built for any target platform and always creates a single compressed 排列三2014079期正版藏机图 file.

该场景资源包可以内置任意目标平台,并总是创建单一压缩的unity3d文件。

the scene can be downloaded and loaded using the www class. you can usewww.loadfromcacheordownloadto cache the downloaded scene after it has been downloaded.

该场景可以被下载并使用www类加载??梢允褂脀ww.loadfromcacheordownload已经被下载后,来缓存下载的场景。

// build a streamed unity3d file. this contain one scene that can be downloaded

// on demand and loaded once it's asset bundle has been loaded.

//构建一个流unity3d文件,包含一个场景,可以按需下载,一旦资源包加载时加载。

@menuitem("build/buildwebplayerstreamed")

static function mybuild(){

var levels : string[] = ["assets/level1.unity"];

buildpipeline.buildstreamedsceneassetbundle( levels, "streamed-level1.unity3d", buildtarget.webplayer);

}

when downloading the built compressed file, you need to callwww.assetbundlein order to make the scene available to theapplication.loadlevel() andapplication.loadleveladditive() functions.

当下载内置的压缩文件,必须调用www.assetbundle以使场景application.loadlevel()和application.loadleveladditive()函数可用。

function start () {

// download compressed scene. if version 5 of the file named "streamed-level1.unity3d" was previously downloaded and cached.

// then unity will completely skip the download and load the decompressed scene directly from disk.

//下载压缩的场景。如果名为streamed-level1.unity3d的文件版本为5,预先下载并缓存。

//然后unity将完全跳过下载并直接从磁盘加载解压的场景。

var download =www.loadfromcacheordownload("//mywebsite.com/streamed-level1.unity3d", 5);

yield download;

// handle error

if (download.error != null)

{

debug.logerror(download.error);

return;

}

// in order to make the scene available from loadlevel, we have to load the asset bundle.

// the assetbundle class also lets you force unload all assets and file storage once it is no longer needed.

//为了使场景loadlevel可用,必须加载资源包

//assetbundle类,还可以强制卸载所有的资源和文件存储,一旦不再需要。

var bundle = download.assetbundle;

// load the level we have just downloaded

//加载刚才下载的关卡

application.loadlevel("level1");

}

相关阅读

文章点评
相关文章
  • 人民日报人民时评:前进的时代需要英雄 2019-06-18
  • 境外媒体:中国商务部严批美方“反复无常,挑起贸易战” 2019-06-16
  • 水银、煮沸的蚁巢、热熨斗:欧洲人的梅毒抗争史 2019-06-03
  • 咨询成果推介泸州长江生态湿地新城概念性规划 2019-06-03
  • 黄河口,大美之诗文章中国国家地理网 2019-05-30
  • 【人事】中共临汾市委组织部公示3名拟任职干部 2019-05-18
  • 习近平与人民日报那些事 2019-05-10
  • 很多常用药同属一家族 2019-04-30
  • 小牛犊天生两条腿 走起路来像袋鼠 2019-04-30
  • 就因为“阶级亲”,才应把这些难民送到欧洲。欧洲生活水平高呀,让亲人生活的更好。不能让他们到中国受苦受难呀。 2019-04-27
  • 资管新规来了!打破刚兑  投资者怎么办? 2019-04-27
  • 紫光阁中共中央国家机关工作委员会 2019-04-24
  • 图解:习近平主席这12个金句振奋人心! 2019-04-24
  • 您访问的页面找不回来了 2019-04-07
  • 五莲科技局以“三大”助力动能转换 2019-04-07
  • 725| 539| 435| 587| 984| 883| 868| 981| 563| 262|