mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-22 00:11:41 +00:00
Add progress of async operation
异步操作类增加进度查询。
This commit is contained in:
@@ -108,6 +108,7 @@ namespace YooAsset
|
||||
if (_steps == ESteps.Update)
|
||||
{
|
||||
_appManifestLoader.Update();
|
||||
Progress = _appManifestLoader.Progress();
|
||||
if (_appManifestLoader.IsDone() == false)
|
||||
return;
|
||||
|
||||
@@ -181,6 +182,7 @@ namespace YooAsset
|
||||
if (_steps == ESteps.Update)
|
||||
{
|
||||
_appManifestLoader.Update();
|
||||
Progress = _appManifestLoader.Progress();
|
||||
if (_appManifestLoader.IsDone() == false)
|
||||
return;
|
||||
|
||||
@@ -243,6 +245,16 @@ namespace YooAsset
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载进度
|
||||
/// </summary>
|
||||
public float Progress()
|
||||
{
|
||||
if (_downloader2 == null)
|
||||
return 0;
|
||||
return _downloader2.Progress();
|
||||
}
|
||||
|
||||
public void Update()
|
||||
{
|
||||
if (IsDone())
|
||||
|
||||
Reference in New Issue
Block a user