public void downloadAndUpdateWwiseBanks() { GameDownloader downloadHelper = this; using (downloadHelper.wc) { string bankArchiveUrl = //"http://142.93.93.56/svn/timeloop/ReleaseWwiseBank.zip"; //"https://drive.google.com/uc?export=download&id=1OLk-C_iaI0ItswTyI_0yfc0ioo8BaqqE"; "https://drive.google.com/uc?export=download&id=14q1oOoVBWz2YZ-OPROvktOdTBIVdHTB1"; string downloadNameSuffix = XuFileUtil.GetDateSuffixForFileName(); downloadHelper.downloadedZipPath = Application.temporaryCachePath + "/" + downloadNameSuffix + "Audio.zip"; Debug.Log(downloadHelper.downloadedZipPath); downloadHelper.finished = false; downloadHelper.downloadPercentage = 0; downloadHelper.wc.DownloadProgressChanged += downloadHelper.wc_DownloadProgressChanged; downloadHelper.wc.DownloadFileCompleted += downloadHelper.Wc_DownloadDataCompleted; System.Uri uri = new System.Uri(bankArchiveUrl); Debug.Log(uri); downloadHelper.wc.DownloadFileAsync(uri, downloadHelper.downloadedZipPath); } }
void LoadDownloadedBank() { //string gameFolderName = "tada_no_rei_v2"; string unzipDestination = SwitcherSettings.Data.GamesFolder;// System.IO.Path.Combine(SwitcherSettings.GamesFolder, gameFolderName);//Application.streamingAssetsPath; string originalFilePath = Application.streamingAssetsPath + "/Audio"; bool saveExistingTemporarily = System.IO.Directory.Exists(originalFilePath); string saveVersionOfBank = originalFilePath + "_safe_" + XuFileUtil.GetDateSuffixForFileName(); if (saveExistingTemporarily) { XuFileUtil.MoveFileOrDirectory(originalFilePath, saveVersionOfBank); } //[!!!] Warning will overwrite an existing file with no warning! ZipUtil.Unzip(downloadedZipPath, unzipDestination); XuFileUtil.DeleteFileOrDirectory(downloadedZipPath); }