Unity ResUpdater研究使用2

来源:互联网 发布:cetv4 网络回看 编辑:程序博客网 时间:2024/06/06 00:05

上一篇:http://blog.csdn.net/yikalyosi/article/details/72790175

一些错误:

库中的CheckMd5State类里的doCheckResource函数的 if (isTargetLatest)            {                File.Replace(Application.persistentDataPath + "/" + res_md5_latest,                    Application.persistentDataPath + "/" + res_md5, null);                File.Replace(Application.persistentDataPath + "/" + CheckVersionState.res_version_latest,                    Application.persistentDataPath + "/" + CheckVersionState.res_version, null);            }改为 if (isTargetLatest)            {                if (!File.Exists(Application.persistentDataPath + "/" + res_md5))                {                    File.Move(Application.persistentDataPath + "/" + res_md5_latest,                        Application.persistentDataPath + "/" + res_md5);                }                else                {                    File.Replace(Application.persistentDataPath + "/" + res_md5_latest,                        Application.persistentDataPath + "/" + res_md5, null);                }                if (!File.Exists(Application.persistentDataPath + "/" + CheckVersionState.res_version))                {                    File.Move(Application.persistentDataPath + "/" + CheckVersionState.res_version_latest,                        Application.persistentDataPath + "/" + CheckVersionState.res_version);                }                else                {                    File.Replace(Application.persistentDataPath + "/" + CheckVersionState.res_version_latest,                        Application.persistentDataPath + "/" + CheckVersionState.res_version, null);                }            }
Downloader.cs的StartDownload函数中:webclient.DownloadFileAsync(new Uri(hosts[idx] + serveInfo.url), outputPath + serveInfo.fn, serveInfo.fn);改为webclient.DownloadFileAsync(new Uri(hosts[idx] + serveInfo.url), outputPath +"/"+ serveInfo.fn, serveInfo.fn);
原创粉丝点击