public void LoadScene(string sceneName, LoadSceneDoneCallback loadSceneDoneCallback, LoadSceneUpdateProgressCallback updateCallback) { this.mSceneName = sceneName; this.mOperation = SceneManager.LoadSceneAsync(sceneName); this.mLoadSceneDoneCallback = loadSceneDoneCallback; this.mUpdateProgressCallback = updateCallback; }
public AssetBundleSceneLoader(string sceneName, bool additive, LoadSceneDoneCallback loadDone, LoadSceneUpdateCallback updateProgress) { base.SceneName = sceneName; base.LoadDoneCallback = loadDone; base.LoadUpdateCallback = updateProgress; this.additive = additive; CheckDependences(); string wwwPath = LocalPath.AssetBundlePath + sceneName.ToLower(); this.www = new WWW(wwwPath); }
public AssetBundleSceneLoader(string sceneName, bool additive, LoadSceneDoneCallback loadDone, LoadSceneUpdateCallback updateProgress) { base.SceneName = sceneName; base.LoadDoneCallback = loadDone; base.LoadUpdateCallback = updateProgress; this.additive = additive; CheckDependences(); string wwwPath = ResMgr.AssetBundlePath + sceneName.ToLower(); this.www = new WWW(wwwPath); }
public SceneLoader(string sceneName, bool additive, LoadSceneDoneCallback loadDone, LoadSceneUpdateCallback updateProgress) { this.SceneName = sceneName; this.LoadDoneCallback = loadDone; this.LoadUpdateCallback = updateProgress; int end = sceneName.LastIndexOf('.'); string scenePath = sceneName.Substring(0, (end == -1 ? sceneName.Length : end)); if (additive) this.op = Application.LoadLevelAdditiveAsync(scenePath); else this.op = Application.LoadLevelAsync(scenePath); }
/// <summary> /// 进入场景 /// </summary> /// <param name="loadingSceneName">Loading场景名字,忽略路径,name.scene格式</param> /// <param name="loadingSceneDoneCallback">Loading场景加载完成回调,给予自定义Loading场景显示逻辑入口</param> /// <param name="sceneName">真正要加载的场景名,格式同loadingSceneName</param> /// <param name="logicResNames">逻辑资源名,这里只必要资源,即场景进入后所需的必要资源</param> /// <param name="loadSceneDoneCallback">场景加载完成回调,一般用于场景逻辑初始化</param> /// <param name="loadSceneUpdateProgressCallback">场景加载进度回调,用于Loading显示</param> public void EnterScene(string loadingSceneName, LoadSceneDoneCallback loadingSceneDoneCallback, string sceneName, string[] logicResNames, LoadSceneDoneCallback loadSceneDoneCallback, LoadSceneUpdateProgressCallback loadSceneUpdateProgressCallback) { this.curSceneName = sceneName; this.curLogicResNames = logicResNames; this.curLoadingSceneDoneCallback = loadingSceneDoneCallback; this.curLoadSceneDoneCallback = loadSceneDoneCallback; this.curUpdateProgressCallback = loadSceneUpdateProgressCallback; // 4.释放中间资源 ResMgr.Instance().Unload(); // 1.加载Loading场景 ResMgr.Instance().LoadScene(loadingSceneName, false, OnLoadingSceneDone, null); }
public SceneLoader(string sceneName, bool additive, LoadSceneDoneCallback loadDone, LoadSceneUpdateCallback updateProgress) { this.SceneName = sceneName; this.LoadDoneCallback = loadDone; this.LoadUpdateCallback = updateProgress; int end = sceneName.LastIndexOf('.'); string scenePath = sceneName.Substring(0, (end == -1 ? sceneName.Length : end)); if (additive) { this.op = SceneManager.LoadSceneAsync(scenePath, LoadSceneMode.Additive); } else { this.op = SceneManager.LoadSceneAsync(scenePath, LoadSceneMode.Single); } }
public SceneLoader(string sceneName, bool additive, LoadSceneDoneCallback loadDone, LoadSceneUpdateCallback updateProgress) { this.SceneName = sceneName; this.LoadDoneCallback = loadDone; this.LoadUpdateCallback = updateProgress; int end = sceneName.LastIndexOf('.'); string scenePath = sceneName.Substring(0, (end == -1 ? sceneName.Length : end)); if (additive) this.op = UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(scenePath,LoadSceneMode.Additive); else this.op = UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(scenePath,LoadSceneMode.Single); }