internal override void Load() { if (!string.IsNullOrEmpty(assetBundleName)) { bundleRequest = AssetsManger.LoadBundle(assetBundleName); if (bundleRequest != null) { SceneManager.LoadScene(sceneName, loadSceneMode); } } else { try { SceneManager.LoadScene(sceneName, loadSceneMode); loadState = LoadState.LoadAsset; } catch (Exception e) { Log.Error(e); error = e.ToString(); loadState = LoadState.Loaded; } } }
internal override void Unload() { if (_request != null) { _request.Release(); _request = null; } }
internal override void Unload() { if (bundleRequest != null) { bundleRequest.Release(); bundleRequest = null; } asset = null; }
internal static void UnloadDependencies(BundleRequest request) { for (var i = 0; i < request.dependencies.Count; i++) { var item = request.dependencies[i]; item.Release(); } request.dependencies.Clear(); }
internal override void Load() { _assetName = Path.GetFileNameWithoutExtension(url); if (GameUtility.Assets.runtimeMode) { _request = AssetsManger.LoadBundle(_assetName.ToLower(), true); _request.completed = Request_completed; loadState = LoadState.LoadAssetBundle; } else { loadState = LoadState.Loaded; } }
internal static void LoadDependencies(BundleRequest request, string assetBundleName, bool async) { var dependencies = GetAllDependencies(assetBundleName); if (dependencies.Length <= 0) { return; } for (var i = 0; i < dependencies.Length; i++) { var item = dependencies[i]; request.dependencies.Add(LoadBundle(item, async)); } }
internal override void Unload() { if (bundleRequest != null) { bundleRequest.Release(); } if (loadSceneMode == LoadSceneMode.Additive) { if (SceneManager.GetSceneByName(sceneName).isLoaded) { SceneManager.UnloadSceneAsync(sceneName); } } bundleRequest = null; }
void ReleaseByBundle(BundleRequest bundle) { if (bundle.url.Equals(url)) { base.Release(); return; } if (_parents.Contains(bundle)) { return; } _parents.Add(bundle); foreach (var child in bundle.dependencies) { ReleaseByBundle(child); } }
internal static void UnloadBundle(BundleRequest bundle) { bundle.Release(); }