Update AssetSystem

pull/51/head
hevinci 2022-11-26 11:29:39 +08:00
parent 5718d57b88
commit e94923c3c6
1 changed files with 9 additions and 0 deletions

View File

@ -90,6 +90,15 @@ namespace YooAsset
/// 资源回收(卸载引用计数为零的资源)
/// </summary>
public void UnloadUnusedAssets()
{
// 注意:资源包之间可能存在多层深层嵌套,需要多次循环释放。
int loopCount = 10;
for (int i = 0; i < loopCount; i++)
{
UnloadUnusedAssetsInternal();
}
}
private void UnloadUnusedAssetsInternal()
{
if (_simulationOnEditor)
{