Unity3D技术之获取关卡的流进度语法详解
2015-02-12 12:24
369 查看
Application.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 函数.
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 函数
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();
}
}
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 函数.
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 函数
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();
}
}
相关文章推荐
- Unity3D技术之加载游戏场景并显示进度条实现详解
- Unity Application.GetStreamProgressForLevel 获取关卡的流进度语法复习
- 12、Windows驱动开发技术详解笔记(8) 基本语法回顾
- Application.GetStreamProgressForLevel 获取关卡的流进度
- Unity3D技术之光照贴图快速入门详解
- Unity3D技术之参考坐标系详解
- 9、Windows驱动开发技术详解笔记(5) 基本语法回顾
- Unity3D技术之CG环境配置详解
- Unity3D技术之资源数据库 (AssetDatabase)详解
- Unity3D技术之Unity3D中的协程(Coroutine)详解
- Python开发技术详解-笔记_第02章-基本语法
- Unity3D技术之资源数据库 (AssetDatabase)详解
- unity3d开发实战《啪啪三国》技术详解!
- Unity3D技术之Android游戏包详解
- Unity3D技术之深入了解光照贴图详解
- delphi技术专题---获取网卡物理地址之NB30.pas单元TNCB详解以及源代码分享
- unity3d开发实战《啪啪三国》技术详解
- Unity3D技术之光照贴图快速入门详解
- Unity3D技术之摄像机功能详解
- Unity3d技术之关于射线的制作详解