using UnityEngine;
using System.Collections;
public class GameSchedule : MonoBehaviour {
private GameObject Schedule;//进度条slider
AsyncOperation acOp;
float i = 0;
void Awake()
{
Schedule = GameObject.Find("GameSchedule");
void Start ()
{
StartCoroutine(StartLoading("Scene02"));
}
void Update ()
{
Schedule.GetComponent<UISlider>().value = i/100;
{
acOp = Application.LoadLevelAsync(str);
acOp.allowSceneActivation = false;
while (i < 100)
{
i++;
yield return new WaitForEndOfFrame();
}
acOp.allowSceneActivation = true;
}
}
using System.Collections;
public class GameSchedule : MonoBehaviour {
private GameObject Schedule;//进度条slider
AsyncOperation acOp;
float i = 0;
void Awake()
{
Schedule = GameObject.Find("GameSchedule");
void Start ()
{
StartCoroutine(StartLoading("Scene02"));
}
void Update ()
{
Schedule.GetComponent<UISlider>().value = i/100;
}
{
acOp = Application.LoadLevelAsync(str);
acOp.allowSceneActivation = false;
while (i < 100)
{
i++;
yield return new WaitForEndOfFrame();
}
acOp.allowSceneActivation = true;
}
}