コード例 #1
0
 public AssetBundlesDownloader(string url, string cacheFilePath)
 {
     if (!url.StartsWith("file://"))
     {
         url = $"file://{url}";
     }
     _assetBundlesRootUrl = Path.Combine(url, AssetBundlesFileSystem.GetTargetName());
     _cacheFilePath       = cacheFilePath;
 }
コード例 #2
0
            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)));
                }
            }
コード例 #3
0
 public override bool HasCache(string assetBundleName) => AssetBundlesFileSystem.AssetBundleExists(assetBundleName);