mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-26 02:30:18 +00:00
Add progress of async operation
异步操作类增加进度查询。
This commit is contained in:
@@ -195,6 +195,7 @@ namespace YooAsset
|
||||
// 3. 检测APK拷贝文件结果
|
||||
if (_steps == ESteps.CheckDownloadFromApk)
|
||||
{
|
||||
Progress = _fileRequester.Progress();
|
||||
if (_fileRequester.IsDone() == false)
|
||||
return;
|
||||
|
||||
@@ -336,6 +337,7 @@ namespace YooAsset
|
||||
// 3. 检测服务器下载结果
|
||||
if (_steps == ESteps.CheckDownloadFromWeb)
|
||||
{
|
||||
Progress = _downloader.DownloadProgress;
|
||||
if (_downloader.IsDone() == false)
|
||||
return;
|
||||
|
||||
@@ -363,6 +365,7 @@ namespace YooAsset
|
||||
// 5. 检测APK拷贝文件结果
|
||||
if (_steps == ESteps.CheckDownloadFromApk)
|
||||
{
|
||||
Progress = _fileRequester.Progress();
|
||||
if (_fileRequester.IsDone() == false)
|
||||
return;
|
||||
|
||||
|
||||
@@ -26,19 +26,6 @@ namespace YooAsset
|
||||
private Scene _scene;
|
||||
private AsyncOperation _asyncOp;
|
||||
|
||||
/// <summary>
|
||||
/// 场景卸载进度
|
||||
/// </summary>
|
||||
public float Progress
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_asyncOp == null)
|
||||
return 0;
|
||||
return _asyncOp.progress;
|
||||
}
|
||||
}
|
||||
|
||||
internal UnloadSceneOperation(string error)
|
||||
{
|
||||
_flag = EFlag.Error;
|
||||
@@ -87,6 +74,7 @@ namespace YooAsset
|
||||
|
||||
if (_steps == ESteps.Checking)
|
||||
{
|
||||
Progress = _asyncOp.progress;
|
||||
if (_asyncOp.isDone == false)
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user