mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-25 18:20:15 +00:00
style : Code text indent format
This commit is contained in:
@@ -100,17 +100,17 @@ namespace YooAsset
|
||||
DownloaderBase newDownloader = null;
|
||||
YooLogger.Log($"Beginning to download bundle : {bundleInfo.Bundle.BundleName} URL : {bundleInfo.RemoteMainURL}");
|
||||
#if UNITY_WEBGL
|
||||
if (bundleInfo.Bundle.Buildpipeline == EDefaultBuildPipeline.RawFileBuildPipeline.ToString())
|
||||
{
|
||||
FileUtility.CreateFileDirectory(bundleInfo.CachedDataFilePath);
|
||||
System.Type requesterType = typeof(FileGeneralRequest);
|
||||
newDownloader = new FileDownloader(bundleInfo, requesterType, failedTryAgain, timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
System.Type requesterType = typeof(AssetBundleWebRequest);
|
||||
newDownloader = new WebDownloader(bundleInfo, requesterType, failedTryAgain, timeout);
|
||||
}
|
||||
if (bundleInfo.Bundle.Buildpipeline == EDefaultBuildPipeline.RawFileBuildPipeline.ToString())
|
||||
{
|
||||
FileUtility.CreateFileDirectory(bundleInfo.CachedDataFilePath);
|
||||
System.Type requesterType = typeof(FileGeneralRequest);
|
||||
newDownloader = new FileDownloader(bundleInfo, requesterType, failedTryAgain, timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
System.Type requesterType = typeof(AssetBundleWebRequest);
|
||||
newDownloader = new WebDownloader(bundleInfo, requesterType, failedTryAgain, timeout);
|
||||
}
|
||||
#else
|
||||
FileUtility.CreateFileDirectory(bundleInfo.CachedDataFilePath);
|
||||
bool resumeDownload = bundleInfo.Bundle.FileSize >= _breakpointResumeFileSize;
|
||||
|
||||
@@ -75,16 +75,16 @@ namespace YooAsset
|
||||
Status = ERequestStatus.Success;
|
||||
}
|
||||
#else
|
||||
RequestHttpCode = _webRequest.responseCode;
|
||||
if (_webRequest.isNetworkError || _webRequest.isHttpError)
|
||||
{
|
||||
RequestNetError = _webRequest.error;
|
||||
Status = ERequestStatus.Error;
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = ERequestStatus.Success;
|
||||
}
|
||||
RequestHttpCode = _webRequest.responseCode;
|
||||
if (_webRequest.isNetworkError || _webRequest.isHttpError)
|
||||
{
|
||||
RequestNetError = _webRequest.error;
|
||||
Status = ERequestStatus.Error;
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = ERequestStatus.Success;
|
||||
}
|
||||
#endif
|
||||
|
||||
// 缓存加载的AssetBundle对象
|
||||
|
||||
@@ -59,16 +59,16 @@ namespace YooAsset
|
||||
Status = ERequestStatus.Success;
|
||||
}
|
||||
#else
|
||||
RequestHttpCode = _webRequest.responseCode;
|
||||
if (_webRequest.isNetworkError || _webRequest.isHttpError)
|
||||
{
|
||||
RequestNetError = _webRequest.error;
|
||||
Status = ERequestStatus.Error;
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = ERequestStatus.Success;
|
||||
}
|
||||
RequestHttpCode = _webRequest.responseCode;
|
||||
if (_webRequest.isNetworkError || _webRequest.isHttpError)
|
||||
{
|
||||
RequestNetError = _webRequest.error;
|
||||
Status = ERequestStatus.Error;
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = ERequestStatus.Success;
|
||||
}
|
||||
#endif
|
||||
|
||||
// 最终释放下载器
|
||||
|
||||
@@ -48,8 +48,8 @@ namespace YooAsset
|
||||
var handler = new DownloadHandlerFile(_tempFilePath, true);
|
||||
handler.removeFileOnAbort = false;
|
||||
#else
|
||||
var handler = new DownloadHandlerFileRange(tempFilePath, _bundleInfo.Bundle.FileSize, _webRequest);
|
||||
_downloadHandle = handler;
|
||||
var handler = new DownloadHandlerFileRange(tempFilePath, _bundleInfo.Bundle.FileSize, _webRequest);
|
||||
_downloadHandle = handler;
|
||||
#endif
|
||||
_webRequest.downloadHandler = handler;
|
||||
_webRequest.disposeDownloadHandlerOnDispose = true;
|
||||
@@ -83,16 +83,16 @@ namespace YooAsset
|
||||
Status = ERequestStatus.Success;
|
||||
}
|
||||
#else
|
||||
RequestHttpCode = _webRequest.responseCode;
|
||||
if (_webRequest.isNetworkError || _webRequest.isHttpError)
|
||||
{
|
||||
RequestNetError = _webRequest.error;
|
||||
Status = ERequestStatus.Error;
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = ERequestStatus.Success;
|
||||
}
|
||||
RequestHttpCode = _webRequest.responseCode;
|
||||
if (_webRequest.isNetworkError || _webRequest.isHttpError)
|
||||
{
|
||||
RequestNetError = _webRequest.error;
|
||||
Status = ERequestStatus.Error;
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = ERequestStatus.Success;
|
||||
}
|
||||
#endif
|
||||
|
||||
// 注意:下载断点续传文件发生特殊错误码之后删除文件
|
||||
|
||||
@@ -71,10 +71,10 @@ namespace YooAsset
|
||||
#if UNITY_2020_3_OR_NEWER
|
||||
return _webRequest.result != UnityWebRequest.Result.Success;
|
||||
#else
|
||||
if (_webRequest.isNetworkError || _webRequest.isHttpError)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
if (_webRequest.isNetworkError || _webRequest.isHttpError)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user