Unity3D圣典3.3版本-中文版
文集大纲加载中……
本文档使用 MrDoc 发布
-
+
首页
Application.GetStreamProgressForLevel 获取关卡的流进度
# [Application](Application.html).GetStreamProgressForLevel 获取关卡的流进度 static function *GetStreamProgressForLevel* (*levelIndex* : int) : float *Description* 描述 How far has the download progressed? [0...1] 下载的进度是多少? In the webplayer this returns the progress of this level. 在 web 播放器中这将返回这个关卡的进度。 参见: [CanStreamedLevelBeLoaded](file:///E:/Program Application.CanStreamedLevelBeLoaded.html) 函数. * [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(); } } ``` • static function *GetStreamProgressForLevel* (*levelName* : string) : float *Description* 描述 How far has the download progressed? [0...1] 下载的进度是多少? In the webplayer this returns the progress of this level. 在 web 播放器中这将返回这个关卡的进度。 参见: [CanStreamedLevelBeLoaded](Application.CanStreamedLevelBeLoaded.html) 函数 * [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(); } } ```
da
2022年5月13日 22:57
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
关于 MrDoc
觅思文档MrDoc
是
州的先生
开发并开源的在线文档系统,其适合作为个人和小型团队的云笔记、文档和知识库管理工具。
如果觅思文档给你或你的团队带来了帮助,欢迎对作者进行一些打赏捐助,这将有力支持作者持续投入精力更新和维护觅思文档,感谢你的捐助!
>>>捐助鸣谢列表
微信
支付宝
QQ
PayPal
Markdown文件
分享
链接
类型
密码
更新密码