找回密码
 注册帐号

扫一扫,访问微社区

application.getstreamprogressforlevel 获取关卡的流进度

2014-12-31 07:46| 发布者: 杨炎| 查看: 2075| 评论: 0|原作者: 蛮牛|来自: unity3d脚本manual

摘要: application.getstreamprogressforlevel 获取关卡的流进度static functiongetstreamprogressforlevel(levelindex: int) : floatdescription描述how far has the download progressed? 下载的进度是多少?in the webp ...

application.getstreamprogressforlevel 获取关卡的流进度

static functiongetstreamprogressforlevel(levelindex: int) : float

description描述

how far has the download progressed? [0...1]

下载的进度是多少?

in the webplayer this returns the progress of this level.

在web播放器中这将返回这个关卡的进度。

参见:canstreamedlevelbeloaded函数.

c#

javascript

using unityengine;

using system.collections;

public class example :monobehaviour{

public float percentageloaded = 0;

void update() {

if (application.getstreamprogressforlevel(1) == 1)

guitext.text = "level at index 1 has been fully streamed!";

else {

percentageloaded = application.getstreamprogressforlevel(1) * 100;

guitext.text = percentageloaded.tostring();

}

}

}

// print on a guitext how much has been streamed level at index 1

//在文本框打印在场景1里下载了多少?

// when finished streaming, print "level 1 has been fully streamed!"

//当完成时,打印"level 1 has been fully streamed!"

var percentageloaded : float = 0;

function update() {

if(application.getstreamprogressforlevel(1) == 1) {

guitext.text = "level at index 1 has been fully streamed!";

} else {

percentageloaded = application.getstreamprogressforlevel(1) * 100;

guitext.text = percentageloaded.tostring();

}

}

o static functiongetstreamprogressforlevel(levelname: string) : float

description描述

how far has the download progressed? [0...1]

下载的进度是多少?

in the webplayer this returns the progress of this level.

在web播放器中这将返回这个关卡的进度。

参见:canstreamedlevelbeloaded函数

c#

javascript

using unityengine;

using system.collections;

public class example :monobehaviour{

public float percentageloaded = 0;

void update() {

if (application.getstreamprogressforlevel("level1") == 1)

guitext.text = "level 1 has been fully streamed!";

else {

percentageloaded = application.getstreamprogressforlevel("level1") * 100;

guitext.text = percentageloaded.tostring();

}

}

}

// print on a guitext how much has been streamed "level1"

//在文本框打印在场景"level1"里下载了多少?

// when finished streaming, print "level1 has been fully streamed!"

//当完成时,打印"level 1 has been fully streamed!"

var percentageloaded : float = 0;

function update() {

if(application.getstreamprogressforlevel("level1") == 1) {

guitext.text = "level 1 has been fully streamed!";

} else {

percentageloaded = application.getstreamprogressforlevel("level1") * 100;

guitext.text = percentageloaded.tostring();

}

}

相关阅读

文章点评
相关文章