コード例 #1
0
ファイル: DownloadManager.cs プロジェクト: llchaha/SomeTips
 private WWWRequest createWWWRequest(BundleDownloadInfo info)
 {
     if (info.localBundle)
     {
         info.url = formatUrl(localRootUrl, info.versionInfo.requestString);
     }
     return(new WWWRequest(info));
 }
コード例 #2
0
ファイル: DownloadManager.cs プロジェクト: llchaha/SomeTips
 public WWWRequest(BundleDownloadInfo info)
 {
     this.info     = info;
     this.priority = info.versionInfo.priority;
     if (this.priority < 0)
     {
         inheriority();
     }
 }
コード例 #3
0
ファイル: DownloadManager.cs プロジェクト: llchaha/SomeTips
    private void mergeVersion(VersionInfo versionInfo)
    {
        if (!versionInfo.isValue)
        {
            return;
        }

        var newList = new List <BundleDownloadInfo>();

        foreach (var bundleVersionInfo in versionInfo.bundles)
        {
            var bundleName = bundleVersionInfo.name;
            BundleDownloadInfo downloadInfo = null;
            if (bundleDict.ContainsKey(bundleName))
            {
                downloadInfo = bundleDict[bundleName];
            }
            else
            {
                downloadInfo         = new BundleDownloadInfo();
                downloadInfo.name    = bundleName;
                downloadInfo.version = 0;
            }

            if (downloadInfo.versionInfo == null || downloadInfo.versionInfo.crc != bundleVersionInfo.crc ||
                (!downloadInfo.localBundle && !Caching.IsVersionCached(downloadInfo.url, downloadInfo.version)))
            {
                downloadInfo.versionInfo = bundleVersionInfo;
                downloadInfo.version++;
                downloadInfo.localBundle  = versionInfo.rootUrl == localRootUrl;
                downloadInfo.url          = formatUrl(versionInfo.rootUrl, bundleVersionInfo.requestString);
                downloadInfo.needDownload = !downloadInfo.localBundle;
            }

            newList.Add(downloadInfo);
        }

        bundles    = newList;
        bmConfiger = versionInfo.bmConfiger ?? bmConfiger;

        BMUtility.SaveToPersistentData(bundles, DOWNLOAD_INFO_CACHE_NAME);
        BMUtility.SaveToPersistentData(bmConfiger, CONFIGER_CACHE_NAME);
    }