update runtime code

销毁Package的时候清空缓存记录。
pull/122/head
hevinci 2023-05-06 10:42:33 +08:00
parent 4d7fb6301a
commit 812c46adeb
2 changed files with 13 additions and 1 deletions

View File

@ -23,6 +23,15 @@ namespace YooAsset
_cachedDic.Clear();
}
/// <summary>
/// 清空指定包裹的所有缓存数据
/// </summary>
public static void ClearPackage(string packageName)
{
var cache = GetOrCreateCache(packageName);
cache.ClearAll();
}
/// <summary>
/// 获取缓存文件总数
/// </summary>
@ -115,7 +124,7 @@ namespace YooAsset
{
return VerifyingInternal(element.TempDataFilePath, element.FileSize, element.FileCRC, EVerifyLevel.High);
}
/// <summary>
/// 验证记录文件(主线程内操作)
/// </summary>

View File

@ -150,6 +150,9 @@ namespace YooAsset
YooLogger.Log($"Destroy resource package : {packageName}");
_packages.Remove(package);
package.DestroyPackage();
// 清空缓存
CacheSystem.ClearPackage(packageName);
}
/// <summary>