Add progress of async operation

异步操作类增加进度查询。
This commit is contained in:
hevinci
2022-05-07 20:30:16 +08:00
parent ecd4973948
commit bd87e982ef
15 changed files with 61 additions and 21 deletions
@@ -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;