UNITY之加载
来源:互联网 发布:小额贷款那个软件最好 编辑:程序博客网 时间:2024/06/11 14:03
using System.Collections;
public class AsyncLoad01 : MonoBehaviour {
// Use this for initialization
void Start () {
//返回当前场景的索引
print ("LoadedLevel:"+Application.loadedLevel);
//当前场景的名称
print ("loadedLevelName:"+Application.loadedLevelName);
//检测此场景是否正在加载,加载完是返回false,正在加载时返回true
print ("isLoadingLevel:"+Application.isLoadingLevel);
//返回当前可加载的场景数量
print ("LevelCount:"+Application.levelCount);
//检测游戏运行平台:手机,电脑,游戏机,可在枚集类RuntimePlatform中查看
Debug.Log ("platform:"+Application.platform);
//当前游戏是否正在运行
print ("Isplaying:"+Application.isPlaying);
//当前游戏是否处于unity编译模式
print ("isEditor:"+Application.isEditor);
}
// Update is called once per frame
void Update () {
}
}
using UnityEngine;
using System.Collections;
public class Scene01 : MonoBehaviour {
private AsyncOperation asy;
public UISlider slider;
// Use this for initialization
void Start () {
if(slider){
slider.value = 0;
}
StartCoroutine (loadScene());
}
// Update is called once per frame
void Update () {
print (asy.progress);
if (asy.progress < 0.9) {
slider.value = asy.progress;
} else {
slider.value = 1;
}
// if(Input.GetKeyDown(KeyCode.A)){
// //Application.LoadLevel ("Scene02");
// //Application.LoadLevelAdditive ("Scene02");
// Application.LoadLevelAsync ("Scene02");
// //Application.LoadLevelAdditiveAsync ("Scene02");
// }
}
IEnumerator loadScene(){
asy = Application.LoadLevelAsync ("Scene02");
print (asy.progress);
yield return asy;
}
void OnDestroy(){
print ("Scene01 Destroy");
}
}
- Unity 之异步加载
- UNITY之加载
- UNITY之进度条加载场景
- Unity加载火炬之光的场景
- Unity加载火炬之光的场景
- unity动态加载之AssetBundle应用
- unity动态加载之AssetBundle原理
- Unity之如何从AssetBundles加载资源
- Unity加载火炬之光的场景
- Unity游戏之网络图片下载与加载
- unity动态加载之AssetBundle应用
- UNITY之场景和窗口加载框架
- unity之Asset Bundle资源打包加载
- unity 加载
- Unity Application Block 学习笔记 之 延迟加载
- Unity教程之-Unity5.x版本AssetBundle加载研究
- Unity热更新之C#反射加载程序集
- Unity运行Vuforia Demo展示之加载本地Image Target
- aapt
- 自定义事件
- 二叉树中和为某一值的路径
- 基础篇--StringBuffer、StringBuilder、String
- My First Blog
- UNITY之加载
- python 实例变量
- Linux socket 获取温度上报服务器
- C++设计模式之观察者模式
- 动态建树加深搜之——模仿手机九键输入法
- spring cloud config 配置自建git服务器
- 机器学习(2.100)数据知识积累——香农熵
- 关于主键和外键,我犯傻了
- 自定义事件