From c8cdeb2ae19b4ea809f8f7d5c386f349a2ec4a5d Mon Sep 17 00:00:00 2001 From: hevinci Date: Fri, 10 Mar 2023 15:53:28 +0800 Subject: [PATCH] update asset system --- .../Runtime/AssetSystem/Loader/AssetBundleFileLoader.cs | 6 ++++-- .../Runtime/AssetSystem/Loader/RawBundleFileLoader.cs | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Assets/YooAsset/Runtime/AssetSystem/Loader/AssetBundleFileLoader.cs b/Assets/YooAsset/Runtime/AssetSystem/Loader/AssetBundleFileLoader.cs index b3fe009..02aa373 100644 --- a/Assets/YooAsset/Runtime/AssetSystem/Loader/AssetBundleFileLoader.cs +++ b/Assets/YooAsset/Runtime/AssetSystem/Loader/AssetBundleFileLoader.cs @@ -286,10 +286,12 @@ namespace YooAsset // 文件解压 if (_unpacker != null) { - _unpacker.WaitForAsyncComplete = true; - _unpacker.Update(); if (_unpacker.IsDone() == false) + { + _unpacker.WaitForAsyncComplete = true; + _unpacker.Update(); continue; + } } // 保险机制 diff --git a/Assets/YooAsset/Runtime/AssetSystem/Loader/RawBundleFileLoader.cs b/Assets/YooAsset/Runtime/AssetSystem/Loader/RawBundleFileLoader.cs index d2394a2..923e72c 100644 --- a/Assets/YooAsset/Runtime/AssetSystem/Loader/RawBundleFileLoader.cs +++ b/Assets/YooAsset/Runtime/AssetSystem/Loader/RawBundleFileLoader.cs @@ -124,13 +124,14 @@ namespace YooAsset DownloadProgress = 1f; DownloadedBytes = (ulong)MainBundleInfo.Bundle.FileSize; - _steps = ESteps.Done; if (File.Exists(FileLoadPath)) { + _steps = ESteps.Done; Status = EStatus.Succeed; } else { + _steps = ESteps.Done; Status = EStatus.Failed; LastError = $"Raw file not found : {FileLoadPath}"; } @@ -148,10 +149,12 @@ namespace YooAsset // 文件解压 if (_unpacker != null) { - _unpacker.WaitForAsyncComplete = true; - _unpacker.Update(); if (_unpacker.IsDone() == false) + { + _unpacker.WaitForAsyncComplete = true; + _unpacker.Update(); continue; + } } // 保险机制