Unity场景预加载
async.allowSceneActivation = false;
private AsyncOperation async; async = SceneManager.LoadSceneAsync("MainScene"); async.allowSceneActivation = false; yield return StartCoroutine(Loading()); IEnumerator Loading() { float curProgress = 0f; while (curProgress<=1f) { float toProgress = async.progress/0.9f; while (curProgress<toProgress) { curProgress += 0.01f; loadbarClass.SetProgress(curProgress); yield return new WaitForEndOfFrame(); } } } // async.allowSceneActivation = true;