Exemplo n.º 1
0
        internal void RealLoad(WebDownload download, ABInfo abInfo, BackGroundQueue bQueue, string urlHost, string timestamp = "")
        {
            string abName = abInfo.abName;
            bool   appCrc = HugulaSetting.instance != null ? HugulaSetting.instance.appendCrcToFile : false;

            if (abInfo.crc32 > 0 && appCrc)
            {
                abName = CUtils.InsertAssetBundleName(abName, "_" + abInfo.crc32.ToString());
            }

            Uri url = null;

            if (string.IsNullOrEmpty(timestamp))
            {
                url = new Uri(CUtils.PathCombine(urlHost, abName));
            }
            else
            {
                url = new Uri(CUtils.PathCombine(urlHost, abName + "?" + timestamp));
            }
            string path = GetTmpFilePath(abInfo);

            FileHelper.CheckCreateFilePathDirectory(path);
            if (abInfo.size < BreakPointLength)
            {
                download.DownloadFileAsync(url, path);
            }
            else
            {
                download.DownloadFileMultiAsync(url, path);
            }

#if !HUGULA_RELEASE
            Debug.LogFormat(" begin load {0} ,save path ={1},abInfo.state={2} ,webClient({3})", url.AbsoluteUri, path, abInfo.state, download);
#endif
        }