//アセットバンドルマニフェストをキャッシュからロードして追加する
        public IEnumerator LoadCacheManifestAsync(string rootUrl, string relativeUrl, Action onComplete, Action onFailed)
        {
            string url = GetCachePath(relativeUrl);

            url = FilePathUtil.AddFileProtocol(url);
            WWWEx wwwEx = new WWWEx(url);

            wwwEx.OnUpdate   = OnDownloadingManifest;
            wwwEx.RetryCount = 0;
            wwwEx.TimeOut    = 0.1f;
            return(wwwEx.LoadAssetBundleByNameAsync <AssetBundleManifest>(
                       AssetBundleManifestName,
                       false,
                       (manifest) =>
            {
                AddAssetBundleManifest(rootUrl, manifest);
                if (onComplete != null)
                {
                    onComplete();
                }
            },
                       () =>
            {
                if (onFailed != null)
                {
                    onFailed();
                }
            }
                       ));
        }
        //アセットバンドルマニフェストをDLして情報を追加
        public IEnumerator DownloadManifestAsync(string rootUrl, string relativeUrl, Action onComplete, Action onFailed)
        {
            string url = FilePathUtil.Combine(rootUrl, relativeUrl);

            url = DLCManager.CreateDLCUrlForUtage(url);  //url = FilePathUtil.ToVersionManagerUrl(url);
            WWWEx wwwEx = new WWWEx(url);

            wwwEx.StoreBytes = true;
            wwwEx.OnUpdate   = OnDownloadingManifest;
            wwwEx.RetryCount = retryCount;
            wwwEx.TimeOut    = timeOut;
//			Debug.Log("Load Start " + url);
            return(wwwEx.LoadAssetBundleByNameAsync <AssetBundleManifest>(
                       AssetBundleManifestName,
                       false,
                       (manifest) =>
            {
                AddAssetBundleManifest(rootUrl, manifest);
                if (UseCacheManifest)
                {
                    string path = GetCachePath(relativeUrl);
                    FileIOManager.CreateDirectory(FilePathUtil.GetDirectoryPath(path) + "/");
                    FileIOManager.Write(path, wwwEx.Bytes);
                }
                if (onComplete != null)
                {
                    onComplete();
                }
            },
                       () =>
            {
                if (onFailed != null)
                {
                    onFailed();
                }
            }
                       ));
        }
Пример #3
0
        //アセットバンドルマニフェストをDLして情報を追加
        public IEnumerator DownloadManifestAsync(string rootUrl, string relativeUrl, Action onComplete, Action onFailed)
        {
            string url = FilePathUtil.Combine(rootUrl, relativeUrl);

            url = FilePathUtil.ToCacheClearUrl(url);
            WWWEx wwwEx = new WWWEx(url);

            if (UseCacheManifest)
            {
                wwwEx.IoManager  = FileIOManager;
                wwwEx.WriteLocal = true;
                wwwEx.WritePath  = GetCachePath(relativeUrl);
            }
            wwwEx.OnUpdate   = OnDownloadingManifest;
            wwwEx.RetryCount = retryCount;
            wwwEx.TimeOut    = timeOut;
//			Debug.Log("Load Start " + url);
            return(wwwEx.LoadAssetBundleByNameAsync <AssetBundleManifest>(
                       AssetBundleManifestName,
                       false,
                       (manifest) =>
            {
                AddAssetBundleManifest(rootUrl, manifest);
                if (onComplete != null)
                {
                    onComplete();
                }
            },
                       () =>
            {
                if (onFailed != null)
                {
                    onFailed();
                }
            }
                       ));
        }