update cache system

优化了缓存系统初始化逻辑,支持分帧获取所有缓存文件。
This commit is contained in:
hevinci
2023-02-28 18:25:27 +08:00
parent 7c4dbb1f38
commit ebcb05cc55
8 changed files with 257 additions and 67 deletions

View File

@@ -84,6 +84,8 @@ namespace YooAsset
internal static class PersistentHelper
{
private const string CacheFolderName = "CacheFiles";
private const string CachedBundleFileFolder = "BundleFiles";
private const string CachedRawFileFolder = "RawFiles";
private const string ManifestFolderName = "ManifestFiles";
private const string AppFootPrintFileName = "ApplicationFootPrint.bytes";
@@ -120,12 +122,21 @@ namespace YooAsset
/// <summary>
/// 获取缓存文件夹路径
/// 获取缓存的BundleFile文件夹路径
/// </summary>
public static string GetCacheFolderPath(string packageName)
public static string GetCachedBundleFileFolderPath(string packageName)
{
string root = PathHelper.MakePersistentLoadPath(CacheFolderName);
return $"{root}/{packageName}";
return $"{root}/{packageName}/{CachedBundleFileFolder}";
}
/// <summary>
/// 获取缓存的RawFile文件夹路径
/// </summary>
public static string GetCachedRawFileFolderPath(string packageName)
{
string root = PathHelper.MakePersistentLoadPath(CacheFolderName);
return $"{root}/{packageName}/{CachedRawFileFolder}";
}
/// <summary>