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 bool LoadLevel(string scene) { if (SceneName == scene) { if (isDone) { CSceneManager.LoadSceneAsync(this.SceneName); } else { AutoLoadScene = true; } return(true); } return(false); }