update file system

This commit is contained in:
何冠峰
2025-02-26 19:31:06 +08:00
parent e4d69d869b
commit 0cdcfe7f52
10 changed files with 114 additions and 24 deletions
@@ -54,18 +54,19 @@ namespace YooAsset
if (_steps == ESteps.DownloadFile)
{
// 注意:下载的异步任务由管理器驱动
// 注意:不加到子任务列表里,防止Abort的时候将下载器直接关闭!
// 注意:边玩边下下载器引用计数没有Release
if (_downloadFileOp == null)
{
DownloadParam downloadParam = new DownloadParam(int.MaxValue, 60);
_downloadFileOp = _fileSystem.DownloadFileAsync(_bundle, downloadParam);
_downloadFileOp.StartOperation();
AddChildOperation(_downloadFileOp);
}
if (IsWaitForAsyncComplete)
_downloadFileOp.WaitForAsyncComplete();
_downloadFileOp.UpdateOperation();
DownloadProgress = _downloadFileOp.DownloadProgress;
DownloadedBytes = _downloadFileOp.DownloadedBytes;
if (_downloadFileOp.IsDone == false)
@@ -271,18 +272,19 @@ namespace YooAsset
if (_steps == ESteps.DownloadFile)
{
// 注意:下载的异步任务由管理器驱动
// 注意:不加到子任务列表里,防止Abort的时候将下载器直接关闭!
// 注意:边玩边下下载器引用计数没有Release
if (_downloadFileOp == null)
{
DownloadParam downloadParam = new DownloadParam(int.MaxValue, 60);
_downloadFileOp = _fileSystem.DownloadFileAsync(_bundle, downloadParam);
_downloadFileOp.StartOperation();
AddChildOperation(_downloadFileOp);
}
if (IsWaitForAsyncComplete)
_downloadFileOp.WaitForAsyncComplete();
_downloadFileOp.UpdateOperation();
DownloadProgress = _downloadFileOp.DownloadProgress;
DownloadedBytes = _downloadFileOp.DownloadedBytes;
if (_downloadFileOp.IsDone == false)
@@ -166,12 +166,6 @@ namespace YooAsset
}
internal override void InternalWaitForAsyncComplete()
{
//TODO 防止下载器挂起陷入无限死循环!
if (_steps == ESteps.None)
{
InternalStart();
}
while (true)
{
//TODO 如果是导入或解压本地文件,执行等待完毕
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.IO;
using System.IO;
using UnityEngine;
using UnityEngine.Networking;
@@ -186,12 +185,6 @@ namespace YooAsset
}
internal override void InternalWaitForAsyncComplete()
{
//TODO 防止下载器挂起陷入无限死循环!
if (_steps == ESteps.None)
{
InternalStart();
}
while (true)
{
//TODO 如果是导入或解压本地文件,执行等待完毕