using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class Loading : MonoBehaviour
{
public Text tipsText;
public GameObject circle;
private float fps = 10.0f;
private float time;
private int nowFram;
AsyncOperation async;
int progress = 0;
void Start()
{
//tipsText.text = LoadingScene.Instance.Tips;
StartCoroutine(LoadScene());
}
IEnumerator LoadScene()
{
yield return new WaitForSeconds(3f);
async = SceneManager.LoadSceneAsync(LoadingScene.Instance.LoadName);
yield return async;
}
void OnGUI()
{
//DrawAnimation();
}
void Update()
{
//circle.transform.Rotate(Vector3.back);
//progress = (int)(async.progress * 100);
}
void DrawAnimation()
{
time += Time.deltaTime;
if (time >= 1.0 / fps)
{
nowFram++;
time = 0;
}
GUI.Label(new Rect(100, 180, 300, 60), "lOAD
异步加载场景loading界面
最新推荐文章于 2020-03-06 16:26:58 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)