排列三中奖新闻:application.loadleveladditiveasync 异步累加关卡

排列三2014079期正版藏机图 www.d0po.cn 2014-12-31 08:34| 发布者: 杨炎| 查看: 2491| 评论: 0|原作者: 蛮牛|来自: unity3d脚本manual

摘要: application.loadleveladditiveasync 异步累加关卡static functionloadleveladditiveasync(levelname: string) :asyncoperationdescription描述loads the level additively and asynchronously in the background.在 ...

application.loadleveladditiveasync 异步累加关卡

static functionloadleveladditiveasync(levelname: string) :asyncoperation

description描述

loads the level additively and asynchronously in the background.

后台异步累加关卡,也就是说在后台非同步加载新的场景,但当前的场景不会被销毁。

loadlevelasync()和loadleveladditiveasync()的不同在于,前者最终加载完成后,上一个场景内容会被卸载,而后者是两者重叠到一起

unlikeloadlevelasync, loadleveladditiveasync does not destroy objects in the current level. objects from the new level are added to the current scene. this is useful for creating continuous virtual worlds, where more content is loaded in as you walk through the environment.

不像loadlevelasync,loadleveladditiveasync不销毁当前关卡的物体。物体从新的关卡添加到当前的场景。这对创建连续的虚拟世界很有用,在你漫步环境,更多的内容被加载进来。

unity will completely load all assets and all objects in the scene in a background loading thread. this allows you to create a completely streaming world where you constantly load and unload different parts of the world based on the player position, without any hiccups in game play.

unity将在后台线程完整加载场景所有资源和物体。这允许你加载一个新的关卡,同时当前的关卡仍在播运行,显示进度条或者创建一个完整的流世界,在那里你不断的加载和卸载基于程序位置不同的部分,在游戏中不会有任何的中断。

isdonevariable from the resultingasyncoperationcan be used to query if the level load has completed. the result of a loadleveladditiveasync can also be used toyieldin a coroutine.

isdone变量来自asyncoperation异步操作的结果,可以用于如果关卡加载完成的查询。loadleveladditiveasync的结果也能在用来yield一个协同程序。

when building a player unity automatically optimizes assets in such a way that loadleveladditiveasync will load them from disk linearly to avoid seek times. note that background loading performance in the unity editor is much lower than in the web player or standalone build. in the editor you might also get more loading hiccups than in the player.

当编译一个游戏unity自动优化资源,loadlevelasync将从硬盘以线性加载它们避免从磁盘寻道时间。

注意,背景加载优先级在unity编辑器远远低于网络播放器或独立版编译。在编辑器你或许也得到比播放器更多的加载中断。

this function requiresunity pro.

这个函数需运行在unity专业版。

参见:asyncoperation,application.backgroundloadingpriority,application.loadlevelasync.

c#

javascript

using unityengine;

using system.collections;

public class example :monobehaviour{

ienumerator start() {

asyncoperation async = application.loadleveladditiveasync("myaddlevel");

yield return async;

debug.log("loading complete");

}

}

function start () {

// load the level named "myaddlevel".

//加载名为myaddlevel的场景

var async : asyncoperation = application.loadleveladditiveasync ("myaddlevel");

yield async;

debug.log("loading complete");

}

相关阅读

文章点评
相关文章
  • 兰州彩民收获2018年度甘肃首枚七乐彩头奖 2019-06-19
  • 人民日报人民时评:前进的时代需要英雄 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
  • 45| 549| 586| 743| 833| 975| 906| 841| 370| 140|