internal ResAsyncInfo LoadDataByServer() { ResAsyncInfo info = new ResAsyncInfo(); info.CurCoroutine = CoroutineInsManager.Instance.StartCoroutine(LoadData(info)); return(info); }
/// <summary> /// 加载配置文件 /// </summary> IEnumerator LoadData(ResAsyncInfo info) { info.Progress = 0.99f; if (AppFacade.Instance.gameManager) { AppFacade.Instance.gameManager.CullGroup.SetCullgroup(); } yield return(new WaitForSeconds(.2f));//强行0.15秒 info.IsDone = true; if (bundle != null) { //bundle.Unload(false); bundle = null; } }
/// <summary> /// 加载配置文件 /// </summary> IEnumerator LoadData(ResAsyncInfo info) { info.Progress = 0.99f; yield return(new WaitForSeconds(.2f));//强行0.15秒 }
private void HandleLoadingProgress() { if (bLoadSceneComplited) { return; } if (null != kLoadingBarAsyncOperation) { if (kLoadingBarAsyncOperation.isDone) { kLoadingBarAsyncOperation = null; UpdateLoadingProgress(0.0f); ObjectPoolManager.Cleanup(); UpdateLoadingTip("加载场景不费流量"); kUnAssetsOperation = Resources.UnloadUnusedAssets(); } } else if (kUnAssetsOperation != null) { if (kUnAssetsOperation.isDone) { kUnAssetsOperation = null; Util.ClearMemory(); string levelName = kTargetScene; // loadSenenBundle(levelName); kLoadingLevelAsyncOperation = SceneManager.LoadSceneAsync(levelName); } else { UpdateLoadingProgress(0.0f + kUnAssetsOperation.progress * 0.15f); } } else if (kLoadConfigResInfo != null) { if (kLoadConfigResInfo.IsDone) { kLoadConfigResInfo = null; bLoadSceneComplited = true; UpdateLoadingProgress(1.0f); } else { UpdateLoadingProgress(kLoadConfigResInfo.Progress); } } else if (null != kLoadingLevelAsyncOperation)//再等待目标场景加载 { if (kLoadingLevelAsyncOperation.isDone) { kLoadingLevelAsyncOperation = null; kLoadConfigResInfo = LoadDataByServer(); if (null != kLevelLoadedCallback) { kLevelLoadedCallback(); kLevelLoadedCallback = null; } } else { UpdateLoadingProgress(0.15f + kLoadingLevelAsyncOperation.progress * 0.8f); } } }