private IEnumerator LoadLevelBundle(string scene) { WWW www = new WWW(CDirectory.MakeFullWWWPath(string.Format("res/scenes/{0}.scene", scene))); while (!www.isDone) { progress = www.progress; yield return(null); } yield return(www); if (!string.IsNullOrEmpty(www.error)) { LOG.LogError("WWW download:" + www.error + " path : " + www.url); yield break; } if (www.isDone) { wwwProgress.Done(); isDone = true; SceneAB = www.assetBundle; www.Dispose(); if (AutoLoadScene) { CSceneManager.LoadSceneAsync(this.SceneName); } } }
public void Load() { loading = true; this.www = null; if (CMisc.isLegalNumber(name) && Global.publishConfig.isDebugOpen) { //CGameHintUI.Show(ErrorCodes.GetTextFormat(ErrorCodes.INVALID_LOAD_PATH, name)); return; } if (!string.IsNullOrEmpty(name) && name != "empty") { this.www = new WWW(CDirectory.MakeFullWWWPath(name)); } }