public override IEnumerator LoadAssetBundle(string assetBundleName, Func <bool, IEnumerator> onComplete) { if (HasCache(assetBundleName)) { if (!IsAssetBundleLoaded(assetBundleName)) { yield return(BundleDownloadCompleted(true, AssetBundlesFileSystem.GetFullPath(assetBundleName))); } yield return(onComplete.Invoke(true)); } else { AssetBundlesDownloader downloader = new AssetBundlesDownloader(_baseUrl, AssetBundlesFileSystem.GetFullPath(assetBundleName)); yield return(downloader.DownloadFromName(assetBundleName, BundleDownloadCompleted)); yield return(onComplete.Invoke(_assetBundles.ContainsKey(assetBundleName))); } }
void Start() { createJSON = gameObject.AddComponent <CreateJSON>(); bundleDownloader = gameObject.AddComponent <AssetBundlesDownloader>(); reConnTimes = 0; }