南山七律排列三预测:buildpipeline.buildstreamedsceneassetbundle 编译流场景资源包

排列三2014079期正版藏机图 www.d0po.cn 2015-1-3 22:27| 发布者: 杨炎| 查看: 3211| 评论: 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-04-07
  • 五莲科技局以“三大”助力动能转换 2019-04-07
  • 匹夫有责之一百一十二—道义大义的博客—强国博客—人民网 2019-03-30
  • 守住青山不放松 护好绿水不辞难——在渝全国人大代表聚焦“共抓大保护、不搞大开发”专题调研记略 2019-03-28
  • 经营者要想“我心换你心”,就要未雨绸缪,让不诚信的诱惑少一点,如此才能在市场中生存下来。反过来说,承担不起亏损就关门歇业,是否也是一种不诚信呢? 2019-03-21
  • 追风上市公司“跌落神坛”-热门标签-华商网数码 2019-03-21
  • 文化艺术交易场所沙龙第一期活动在京顺利举行 2019-03-16
  • 看把你高兴的屁颠屁颠的,光有赞有什么用?我给你个货真价实的 [大红包]。 2019-03-16
  • 候选企业:中国石油呼和浩特石化公司 2019-02-22
  • 我国纳米核心技术取得重大突破 2019-02-22
  • 北京:端午节民俗地图  小枣粽——竹叶红枣糯糯情  2019-01-26
  • 机器人送快递将在西安试点 识别红绿灯还能“车让人” 2019-01-26
  • 首批限竞房正式入市 戳三大盘看详情! ——凤凰网房产北京 2018-12-09
  • 世界杯频爆冷门网友大呼“天台见”!警方:不要冲动,不要跳楼 2018-08-21
  • 始终如一的是:美国优先。 2018-08-21
  • 893| 126| 31| 952| 243| 553| 154| 515| 979| 838|