Update runtime code

优化资源包缓存文件清理方式。
This commit is contained in:
hevinci
2022-11-18 21:33:58 +08:00
parent 1dab0f2b19
commit 49949ecda5
17 changed files with 115 additions and 90 deletions

View File

@@ -97,17 +97,18 @@ namespace YooAsset
/// </summary>
public static void DeleteCacheFolder()
{
string directoryPath = GetCacheFolderPath();
if (Directory.Exists(directoryPath))
Directory.Delete(directoryPath, true);
string root = PathHelper.MakePersistentLoadPath(CacheFolderName);
if (Directory.Exists(root))
Directory.Delete(root, true);
}
/// <summary>
/// 获取缓存文件夹路径
/// </summary>
public static string GetCacheFolderPath()
public static string GetCacheFolderPath(string packageName)
{
return PathHelper.MakePersistentLoadPath(CacheFolderName);
string root = PathHelper.MakePersistentLoadPath(CacheFolderName);
return $"{root}/{packageName}";
}
#region