update runtime code

销毁Package的时候清空缓存记录。
main
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(); _cachedDic.Clear();
} }
/// <summary>
/// 清空指定包裹的所有缓存数据
/// </summary>
public static void ClearPackage(string packageName)
{
var cache = GetOrCreateCache(packageName);
cache.ClearAll();
}
/// <summary> /// <summary>
/// 获取缓存文件总数 /// 获取缓存文件总数
/// </summary> /// </summary>

View File

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