update download system

This commit is contained in:
hevinci
2023-02-24 19:45:05 +08:00
parent a5e24be5d4
commit bcf6372602
7 changed files with 40 additions and 54 deletions
@@ -80,7 +80,7 @@ namespace YooAsset
if (File.Exists(_tempFilePath))
File.Delete(_tempFilePath);
_webRequest = DownloadRequestUtil.NewRequest(_requestURL);
_webRequest = DownloadSystem.NewRequest(_requestURL);
DownloadHandlerFile handler = new DownloadHandlerFile(_tempFilePath);
handler.removeFileOnAbort = true;
_webRequest.downloadHandler = handler;
@@ -109,11 +109,11 @@ namespace YooAsset
}
#if UNITY_2019_4_OR_NEWER
_webRequest = DownloadRequestUtil.NewRequest(_requestURL);
_webRequest = DownloadSystem.NewRequest(_requestURL);
var handler = new DownloadHandlerFile(_tempFilePath, true);
handler.removeFileOnAbort = false;
#else
_webRequest = UnityWebRequestUtil.NewRequest(_requestURL);
_webRequest = DownloadSystem.NewRequest(_requestURL);
var handler = new DownloadHandlerFileRange(_tempFilePath, _bundleInfo.Bundle.FileSize, _webRequest);
_downloadHandle = handler;
#endif