LoadLevelAsync显示加载进度
有时候后台加载场景需要显示加载场景的进度
using UnityEngine; using System.Collections; using UnityEngine.UI; public class Loading : MonoBehaviour { AsyncOperation sync; [SerializeField] private Text _txt; IEnumerator Start () { sync= Application.LoadLevelAsync("Scene"); yield return sync; } void Update () { _txt.text = "Loading " + (sync.progress/1.0f *100).ToString("0"); } }