private void OnComplete() { if (enableVFS) { var dataPath = _savePath + Versions.Dataname; var downloads = _downloader.downloads; if (downloads.Count > 0 && File.Exists(dataPath)) { OnMessage("更新本地版本信息"); var files = new List <VFile>(downloads.Count); foreach (var download in downloads) { files.Add(new VFile { name = download.name, hash = download.hash, len = download.len, }); } var file = files[0]; if (!file.name.Equals(Versions.Dataname)) { Versions.UpdateDisk(dataPath, files); } } Versions.LoadDisk(dataPath); } OnProgress(1); OnMessage("更新完成"); var version = Versions.LoadVersion(_savePath + Versions.Filename); if (version > 0) { OnVersion("资源版本号: v" + Application.version + "res" + version.ToString()); } StartCoroutine(LoadGameScene()); }
private void PrepareDownloads() { if (enableVFS) { var path = string.Format("{0}{1}", _savePath, Versions.Dataname); if (!File.Exists(path)) { AddDownload(_versions[0]); return; } Versions.LoadDisk(path); } for (var i = 1; i < _versions.Count; i++) { var item = _versions[i]; if (Versions.IsNew(string.Format("{0}{1}", _savePath, item.name), item.len, item.hash)) { AddDownload(item); } } }