Unity3d 2种重要方法的使用
来源:互联网 发布:大数据可视化技术综述 编辑:程序博客网 时间:2024/05/22 01:49
Unity3d 2种重要方法的使用
GetStreamProgressForLevel()
in the webplayer, returns the progress of the actual level (from theofficial documentation). With "progress" it's intended the loading progress...Since the game will be stored on a server (generally), a certain time period is required to send the data of a particular scene to the client. The documentation reports a clear example:
Code:
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(); }}
Easy, uh? With this, you can know what percentage of the scene has been "loaded". That is, what percentage of the level has been "streamed" from the server to the client. And you can fill you loading bar accordingly, for the sake of your question. Even with the free version of Unity.
LoadLevelAsync()
(THAT REQUIRES UNITY PRO), instead, loads the level asynchronously in the background (always from the documentation). See this example:
Code:
function Start () { // Load the level named "MyBigLevel". var async : AsyncOperation = Application.LoadLevelAsync ("MyBigLevel"); yield async; Debug.Log ("Loading complete");}
A message will be printed on the console as soon as "MyBigLevel" has been loaded (or, as we said before, "streamed"). It is indicated for performance reasons, that's why it (wisely) requires Unity Pro.
- Unity3d 2种重要方法的使用
- Unity3D重要的函数方法
- unity3d 重要函数方法
- unity3d 重要函数方法
- unity3d 重要函数方法
- unity3d 重要函数方法
- unity3d 重要函数方法
- unity3d 重要函数方法
- Unity3D重要的类
- unity3d 重要类+方法 。。。再来一遍吧。。。
- unity3d学习笔记 重要函数方法总结
- unity3D中常用的几种系统自调用的重要方法
- unity3D中常用的几种系统自调用的重要方法
- 关于Unity3D中的UnitySendMessage方法的使用!!!
- 关于Unity3D中的UnitySendMessage方法的使用!!!
- Unity3D——SendMessage方法的使用
- 【iOS开发-58】tableView初识:5个重要方法的使用和2种样式的区别
- 【Unity3D自学记录】重要的函数
- 自己动手修改宇宙无敌之Slickedit的文件切换标签栏
- UVA 10673 Play with Floor and Ceil
- node.js第一步
- 出想“java.lang.IllegalStateException: Cannot forward after response has been committed”错误
- 各种SQL在PIG中实现
- Unity3d 2种重要方法的使用
- hdu 1075
- 走进C++程序世界------多重继承
- Linux输入输出的I/O缓冲
- Railscasts #2 Dynamic find_by Methods 动态find_by方法
- hud 1176 免费馅饼
- c c++ 把大写字母转换成小写的
- [LeetCode] Merge K sorted lists
- C#的代码审查清单