public static SceneAssetRequest LoadSceneAsync(string path, bool additive) { if (string.IsNullOrEmpty(path)) { Debug.LogError("invalid path"); return(null); } path = GetExistPath(path); var asset = new SceneAssetAsyncRequest(path, additive); if (!additive) { if (_runningScene != null) { _runningScene.Release();; _runningScene = null; } _runningScene = asset; } asset.Load(); asset.Retain(); _scenes.Add(asset); Log(string.Format("LoadScene:{0}", path)); return(asset); }
public static SceneAssetRequest LoadSceneAsync(string path, bool additive) { var asset = new SceneAssetAsyncRequest(path, additive); asset.Load(); asset.Retain(); _scenes.Add(asset); return(asset); }
public static SceneAssetRequest LoadSceneAsync(string path, bool additive = false) { Assert.IsNotNull(path, "path != null"); string assetBundleName; path = GetSearchPath(path, out assetBundleName); var asset = new SceneAssetAsyncRequest(path, additive) { assetBundleName = assetBundleName }; Log(string.Format("LoadSceneAsync:{0}", path)); asset.Load(); asset.Retain(); asset.name = path; LoadingScenes.Add(asset); if (!additive) { if (_runningScene != null) { _runningScene.Release(); _runningScene = null; } _runningScene = asset; } else { if (_runningScene != null) { _runningScene.additives.Add(asset); } } return(asset); }