mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-25 18:20:15 +00:00
@@ -22,11 +22,6 @@ namespace YooAsset
|
||||
private static readonly Dictionary<string, DownloaderBase> _downloaderDic = new Dictionary<string, DownloaderBase>();
|
||||
private static readonly List<string> _removeList = new List<string>(100);
|
||||
|
||||
/// <summary>
|
||||
/// 线程同步
|
||||
/// </summary>
|
||||
public static ThreadSyncContext SyncContext { set; get; }
|
||||
|
||||
/// <summary>
|
||||
/// 自定义下载器的请求委托
|
||||
/// </summary>
|
||||
@@ -53,7 +48,6 @@ namespace YooAsset
|
||||
/// </summary>
|
||||
public static void Initialize()
|
||||
{
|
||||
SyncContext = new ThreadSyncContext();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -61,9 +55,6 @@ namespace YooAsset
|
||||
/// </summary>
|
||||
public static void Update()
|
||||
{
|
||||
if (SyncContext != null)
|
||||
SyncContext.Update();
|
||||
|
||||
// 更新下载器
|
||||
_removeList.Clear();
|
||||
foreach (var valuePair in _downloaderDic)
|
||||
@@ -94,7 +85,6 @@ namespace YooAsset
|
||||
_downloaderDic.Clear();
|
||||
_removeList.Clear();
|
||||
|
||||
SyncContext = null;
|
||||
RequestDelegate = null;
|
||||
CertificateHandlerInstance = null;
|
||||
BreakpointResumeFileSize = int.MaxValue;
|
||||
|
||||
@@ -34,6 +34,11 @@ namespace YooAsset
|
||||
protected float _downloadProgress = 0f;
|
||||
protected ulong _downloadedBytes = 0;
|
||||
|
||||
/// <summary>
|
||||
/// 是否等待异步结束
|
||||
/// 警告:只能用于解压APP内部资源
|
||||
/// </summary>
|
||||
public bool WaitForAsyncComplete = false;
|
||||
|
||||
/// <summary>
|
||||
/// 下载进度(0f~1f)
|
||||
|
||||
@@ -48,6 +48,9 @@ namespace YooAsset
|
||||
// 等待检测结果
|
||||
if (_steps == ESteps.WaitingCheckTempFile)
|
||||
{
|
||||
if (WaitForAsyncComplete)
|
||||
_checkFileOp.Update();
|
||||
|
||||
if (_checkFileOp.IsDone == false)
|
||||
return;
|
||||
|
||||
@@ -220,6 +223,9 @@ namespace YooAsset
|
||||
// 等待验证完成
|
||||
if (_steps == ESteps.WaitingVerifyTempFile)
|
||||
{
|
||||
if (WaitForAsyncComplete)
|
||||
_verifyFileOp.Update();
|
||||
|
||||
if (_verifyFileOp.IsDone == false)
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user