protected virtual Resource CreateResource(string name, LoadPriority priority) { Resource res = new Resource(); res.Name = name; res.Loader.Priority = priority; mDownResource.Add(res); BundleIndexItemInfo bundleInfo = ResourceMgr.GetBundleInfo(name); if (bundleInfo != null) { res.Size = bundleInfo.BundleSize; } res.AddGotWWWCallback(this.OnLoadWWW); return(res); }
internal void EnsureDependencies(string name) { RuntimeBundleInfo assetBelongBundleInfo = ResourceMgr.GetBundleInfo(name); if (assetBelongBundleInfo == null) { Debug.LogError($"can't find asset {name} belong bundle"); return; } for (int i = 0; i < assetBelongBundleInfo.BundleDependencyArray.Length; ++i) { string dependencyBundleName = assetBelongBundleInfo.BundleDependencyArray[i]; if (!HasLoaded(dependencyBundleName)) { ResourceModule.Instance.PreloadBundle(dependencyBundleName, null); } } }
public void SetAssetBundlePersistent(string bundleName) { var bundle = resourceMgr.GetBundleInfo(bundleName); bundle.BundlePersistent = true; }