refactor : wait for sync complete

This commit is contained in:
何冠峰
2024-12-10 16:48:08 +08:00
parent 9bc0577423
commit acf2301028
6 changed files with 25 additions and 21 deletions
@@ -69,6 +69,9 @@ namespace YooAsset
if (_loadBundleOp == null)
_loadBundleOp = BundleFileInfo.LoadBundleFile();
if (IsWaitForAsyncComplete)
_loadBundleOp.WaitForAsyncComplete();
DownloadProgress = _loadBundleOp.DownloadProgress;
DownloadedBytes = _loadBundleOp.DownloadedBytes;
if (_loadBundleOp.IsDone == false)
@@ -101,9 +104,6 @@ namespace YooAsset
{
while (true)
{
if (_loadBundleOp != null)
_loadBundleOp.WaitForAsyncComplete();
if (ExecuteWhileDone())
{
_steps = ESteps.Done;