排列三杀号定胆澳客网:buildpipeline.buildplayer 编译播放器

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

摘要: buildpipeline.buildplayer 编译播放器static functionbuildplayer(levels: string,locationpathname: string,target:buildtarget,options: buildoptions) : stringparameters参数levelsthe scenes to be included i ...

buildpipeline.buildplayer 编译播放器

static functionbuildplayer(levels: string[],locationpathname: string,target:buildtarget,options: buildoptions) : string

parameters参数

levels

the scenes to be included in the build. if empty, the currently open scene will be built. paths are relative to the project folder (assets/mylevels/myscene.unity).

包含在编译中的场景,如果为空,当前打开的场景将被编译。路径相对于项目文件夹(assets/mylevels/myscene.unity).

locationpathname

the path where the application will be built. must include any necessary file extensions, like .exe, .app, .排列三2014079期正版藏机图 or .wdgt.

将被编译应用程序的路径,必须包括所有必要的文件扩展名。

target

thebuildtargetto build.

要编译的buildtarget。

options

additionalbuildoptions, like whether to run the built player.

添加编译选项,例如是否运行那种播放器。

returns

string - an error message if an error occurred.

如果产生错误,返回一个错误消息。

description描述

builds a player (unity pro only).

生成一个播放器(仅用于unity pro)。

use this function to programatically create a build of your project.

使用这个函数通过编程来创建一个你的项目编译。

// 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/streamedscene1.unity", "assets/streamedscene2.unity",

"assets/streamedscene3.unity"];

buildpipeline.buildplayer( levels, "streamedwebplayer.unity3d",

buildtarget.webplayer,buildoptions.buildadditionalstreamedscenes);

}

whenbuildoptions.buildadditionalstreamedscenesis used, the resulting file will not be a traditional player. the result will be a file that can be dynamically loaded in at runtime. in order to dynamically load one of these extra scenes in, download the file using thewwwclass, and make sure to callwww.assetbundle. you don't actually have to callassetbundle.loadall(). as soon as you assignedwww.assetbundleto a variable, from that point on, you can use regularapplication.loadlevel() andapplication.loadleveladditive() calls to load the level as you would usually do.

当buildoptions.buildadditionalstreamedscenes被使用,生成的文件将不是传统的播放器。其结果将是一个可以在运行时动态加载的文件。为了动态加载另一个场景,使用www类下载文件,并确保调用了www.assetbundle。你实际上并不需要调用assetbundle.loadall()。只要你指定www.assetbundle到一个变量,通?;嵴庋?,可以使用普通的application.loadlevel()和application.loadleveladditive() 调用来加载关卡。

// 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文件。这包含一个场景,可以按需下载和加载,一旦它的资源包已被加载。

buildpipeline.buildplayer(

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

buildtarget.webplayer,buildoptions.buildadditionalstreamedscenes);

相关阅读

文章点评
相关文章
  • 紫光阁中共中央国家机关工作委员会 2019-04-24
  • 图解:习近平主席这12个金句振奋人心! 2019-04-24
  • 您访问的页面找不回来了 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
  • 789| 876| 32| 456| 735| 861| 278| 177| 935| 711|