public void LoadLevel(string scene) { if (string.IsNullOrEmpty(scene)) { return; } loadLevel = scene; targetLevel = scene; if (SceneAB != null) { if (SceneAB.LoadLevel(targetLevel)) { return; } DestroyScene(); } if (LoadedLevelName == SceneName.ASYNC_LOADER_SCENE) { if (SceneName.InUnity(targetLevel)) { CSceneManager.LoadScene(targetLevel); } else { LoadLevelAssetBundle(targetLevel, true); } return; } CSceneManager.LoadScene(SceneName.ASYNC_LOADER_SCENE); Progress.Instance.Dispose(); }
public bool LoadLevelAssetBundle(string scene, bool autoload = false) { if (LoadedLevelName == scene) { return(false); } loadLevel = scene; SceneAB = new SceneAssetBundle(scene); if (autoload) { SceneAB.LoadLevel(scene); } return(true); }