update asset system

修复了在销毁Package时,如果存在正在加载的bundle,会导致后续加载该bundle报错的问题。
pull/134/head
hevinci 2023-07-12 20:56:11 +08:00
parent 5931d91b5f
commit ed5ae40cb3
2 changed files with 3 additions and 25 deletions

View File

@ -79,30 +79,6 @@ namespace YooAsset
_isUnloadSafe = true;
}
/// <summary>
/// 销毁
/// </summary>
public void DestroyAll()
{
foreach (var provider in _providerList)
{
provider.Destroy();
}
_providerList.Clear();
_providerDic.Clear();
foreach (var loader in _loaderList)
{
loader.Destroy(true);
}
_loaderList.Clear();
_loaderDic.Clear();
ClearSceneHandle();
DecryptionServices = null;
BundleServices = null;
}
/// <summary>
/// 资源回收(卸载引用计数为零的资源)
/// </summary>
@ -149,10 +125,12 @@ namespace YooAsset
{
foreach (var provider in _providerList)
{
provider.WaitForAsyncComplete();
provider.Destroy();
}
foreach (var loader in _loaderList)
{
loader.WaitForAsyncComplete();
loader.Destroy(true);
}

View File

@ -62,7 +62,7 @@ namespace YooAsset
if (_assetSystemImpl != null)
{
_assetSystemImpl.DestroyAll();
_assetSystemImpl.ForceUnloadAllAssets();
_assetSystemImpl = null;
}
}