update resource manager

优化ForceUnloadAllAssets方法逻辑
This commit is contained in:
hevinci
2023-10-19 19:39:14 +08:00
parent 194afe435a
commit d30a8aefa4
9 changed files with 82 additions and 32 deletions

View File

@@ -65,7 +65,7 @@ namespace YooAsset
// 2. 加载资源对象
if (Status == EStatus.Loading)
{
if (IsWaitForAsyncComplete)
if (IsWaitForAsyncComplete || IsForceDestroyComplete)
{
if (MainAssetInfo.AssetType == null)
AllAssetObjects = OwnerBundle.CacheBundle.LoadAllAssets();
@@ -87,7 +87,7 @@ namespace YooAsset
{
if (_cacheRequest != null)
{
if (IsWaitForAsyncComplete)
if (IsWaitForAsyncComplete || IsForceDestroyComplete)
{
// 强制挂起主线程(注意:该操作会很耗时)
YooLogger.Warning("Suspend the main thread to load unity asset.");