using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public Slider Sliders;//进度条
AsyncOperation asy;
void Start () {
oks.onClick.AddListener(delegate ()
{
load.SetActive(true);
StartCoroutine("run");
});
}
void Update () {
if (asy != null)
Sliders.value = asy.progress;
}
IEnumerator run()
{
asy = SceneManager.LoadSceneAsync("game");
yield return asy;
}
}
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class jump : MonoBehaviour {
public Slider Sliders;//进度条
AsyncOperation asy;
void Start () {
oks.onClick.AddListener(delegate ()
{
load.SetActive(true);
StartCoroutine("run");
});
}
void Update () {
if (asy != null)
Sliders.value = asy.progress;
}
IEnumerator run()
{
asy = SceneManager.LoadSceneAsync("game");
yield return asy;
}
}