update cache system

pull/72/head
hevinci 2023-02-28 19:17:05 +08:00
parent 7c1873e861
commit 3cfc084e62
2 changed files with 16 additions and 6 deletions

View File

@ -39,7 +39,6 @@ namespace YooAsset
{
_findCacheFilesOp = new FindCacheFilesOperation(_packageName);
OperationSystem.StartOperation(_findCacheFilesOp);
_steps = ESteps.VerifyCacheFiles;
}
Progress = _findCacheFilesOp.Progress;
@ -55,7 +54,6 @@ namespace YooAsset
{
_verifyCacheFilesOp = VerifyCacheFilesOperation.CreateOperation(_findCacheFilesOp.VerifyElements);
OperationSystem.StartOperation(_verifyCacheFilesOp);
_steps = ESteps.VerifyCacheFiles;
}
Progress = _verifyCacheFilesOp.Progress;

View File

@ -124,19 +124,31 @@ namespace YooAsset
/// <summary>
/// 获取缓存的BundleFile文件夹路径
/// </summary>
private readonly static Dictionary<string, string> _cachedBundleFileFolder = new Dictionary<string, string>(100);
public static string GetCachedBundleFileFolderPath(string packageName)
{
if (_cachedBundleFileFolder.TryGetValue(packageName, out string value) == false)
{
string root = PathHelper.MakePersistentLoadPath(CacheFolderName);
return $"{root}/{packageName}/{CachedBundleFileFolder}";
value = $"{root}/{packageName}/{CachedBundleFileFolder}";
_cachedBundleFileFolder.Add(packageName, value);
}
return value;
}
/// <summary>
/// 获取缓存的RawFile文件夹路径
/// </summary>
private readonly static Dictionary<string, string> _cachedRawFileFolder = new Dictionary<string, string>(100);
public static string GetCachedRawFileFolderPath(string packageName)
{
if (_cachedRawFileFolder.TryGetValue(packageName, out string value) == false)
{
string root = PathHelper.MakePersistentLoadPath(CacheFolderName);
return $"{root}/{packageName}/{CachedRawFileFolder}";
value = $"{root}/{packageName}/{CachedRawFileFolder}";
_cachedRawFileFolder.Add(packageName, value);
}
return value;
}
/// <summary>