mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-28 11:38:47 +00:00
代码重构
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace YooAsset
|
||||
@@ -20,6 +21,7 @@ namespace YooAsset
|
||||
private readonly SandboxFileSystem _fileSystem;
|
||||
private readonly FSDownloadBundleOptions _options;
|
||||
private readonly DownloadRetryController _downloadRetryController;
|
||||
private IReadOnlyList<string> _candidateUrls;
|
||||
private DownloadFileBaseOperation _downloadFileOp;
|
||||
private ESteps _steps = ESteps.None;
|
||||
|
||||
@@ -172,8 +174,10 @@ namespace YooAsset
|
||||
/// </summary>
|
||||
private string GetRequestUrl(string fileName)
|
||||
{
|
||||
var urls = _fileSystem.RemoteService.GetRemoteUrls(fileName);
|
||||
return _fileSystem.DownloadUrlPolicy.SelectUrl(urls);
|
||||
if (_candidateUrls == null)
|
||||
_candidateUrls = _fileSystem.RemoteService.GetRemoteUrls(fileName);
|
||||
|
||||
return _fileSystem.DownloadUrlPolicy.SelectUrl(_candidateUrls);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,9 +31,9 @@ namespace YooAsset
|
||||
|
||||
#region 自定义参数
|
||||
/// <summary>
|
||||
/// 自定义参数:是否禁用 Unity 内置网络缓存
|
||||
/// 自定义参数:禁用 Unity 内置网络缓存
|
||||
/// </summary>
|
||||
public bool DisableUnityWebCache { get; private set; } = false;
|
||||
public bool DisableUnityWebCache { get; private set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 自定义参数:下载看门狗超时时间(秒)
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace YooAsset
|
||||
public UnityWebRequestCreator WebRequestCreator { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自定义参数:禁用Unity的网络缓存
|
||||
/// 自定义参数:禁用 Unity 内置网络缓存
|
||||
/// </summary>
|
||||
public bool DisableUnityWebCache { get; private set; } = false;
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace YooAsset
|
||||
public UnityWebRequestCreator WebRequestCreator { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 自定义参数:禁用Unity的网络缓存
|
||||
/// 自定义参数:禁用 Unity 内置网络缓存
|
||||
/// </summary>
|
||||
public bool DisableUnityWebCache { get; private set; } = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user