Exemple #1
0
        /// <summary>
        /// 创建下载器
        /// </summary>
        public PatchDownloaderOperation CreatePatchDownloaderByPaths(AssetInfo[] assetInfos, int fileLoadingMaxNumber, int failedTryAgain)
        {
            List <BundleInfo> downloadList = GetDownloadListByPaths(assetInfos);
            var operation = new PatchDownloaderOperation(downloadList, fileLoadingMaxNumber, failedTryAgain);

            return(operation);
        }
Exemple #2
0
        /// <summary>
        /// 创建下载器
        /// </summary>
        public PatchDownloaderOperation CreatePatchDownloaderByTags(string[] tags, int fileLoadingMaxNumber, int failedTryAgain)
        {
            List <BundleInfo> downloadList = GetDownloadListByTags(tags);
            var operation = new PatchDownloaderOperation(downloadList, fileLoadingMaxNumber, failedTryAgain);

            return(operation);
        }
Exemple #3
0
 /// <summary>
 /// 创建补丁下载器,用于下载更新指定的资源列表依赖的资源包文件
 /// </summary>
 /// <param name="assetInfos">资源信息列表</param>
 /// <param name="downloadingMaxNumber">同时下载的最大文件数</param>
 /// <param name="failedTryAgain">下载失败的重试次数</param>
 public static PatchDownloaderOperation CreateBundleDownloader(AssetInfo[] assetInfos, int downloadingMaxNumber, int failedTryAgain)
 {
     DebugCheckInitialize();
     if (_playMode == EPlayMode.EditorSimulateMode || _playMode == EPlayMode.OfflinePlayMode)
     {
         List <BundleInfo> downloadList = new List <BundleInfo>();
         var operation = new PatchDownloaderOperation(downloadList, downloadingMaxNumber, failedTryAgain);
         return(operation);
     }
     else if (_playMode == EPlayMode.HostPlayMode)
     {
         return(_hostPlayModeImpl.CreatePatchDownloaderByPaths(assetInfos, downloadingMaxNumber, failedTryAgain));
     }
     else
     {
         throw new NotImplementedException();
     }
 }
Exemple #4
0
 /// <summary>
 /// 创建补丁下载器,用于下载更新指定的资源列表依赖的资源包文件
 /// </summary>
 /// <param name="locations">资源定位列表</param>
 /// <param name="downloadingMaxNumber">同时下载的最大文件数</param>
 /// <param name="failedTryAgain">下载失败的重试次数</param>
 public static PatchDownloaderOperation CreateBundleDownloader(string[] locations, int downloadingMaxNumber, int failedTryAgain)
 {
     DebugCheckInitialize();
     if (_playMode == EPlayMode.EditorSimulateMode || _playMode == EPlayMode.OfflinePlayMode)
     {
         List <BundleInfo> downloadList = new List <BundleInfo>();
         var operation = new PatchDownloaderOperation(downloadList, downloadingMaxNumber, failedTryAgain);
         return(operation);
     }
     else if (_playMode == EPlayMode.HostPlayMode)
     {
         List <AssetInfo> assetInfos = new List <AssetInfo>(locations.Length);
         foreach (var location in locations)
         {
             AssetInfo assetInfo = ConvertLocationToAssetInfo(location, null);
             assetInfos.Add(assetInfo);
         }
         return(_hostPlayModeImpl.CreatePatchDownloaderByPaths(assetInfos.ToArray(), downloadingMaxNumber, failedTryAgain));
     }
     else
     {
         throw new NotImplementedException();
     }
 }