mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-24 09:40:11 +00:00
update cache system
This commit is contained in:
@@ -39,7 +39,6 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_findCacheFilesOp = new FindCacheFilesOperation(_packageName);
|
_findCacheFilesOp = new FindCacheFilesOperation(_packageName);
|
||||||
OperationSystem.StartOperation(_findCacheFilesOp);
|
OperationSystem.StartOperation(_findCacheFilesOp);
|
||||||
_steps = ESteps.VerifyCacheFiles;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Progress = _findCacheFilesOp.Progress;
|
Progress = _findCacheFilesOp.Progress;
|
||||||
@@ -55,7 +54,6 @@ namespace YooAsset
|
|||||||
{
|
{
|
||||||
_verifyCacheFilesOp = VerifyCacheFilesOperation.CreateOperation(_findCacheFilesOp.VerifyElements);
|
_verifyCacheFilesOp = VerifyCacheFilesOperation.CreateOperation(_findCacheFilesOp.VerifyElements);
|
||||||
OperationSystem.StartOperation(_verifyCacheFilesOp);
|
OperationSystem.StartOperation(_verifyCacheFilesOp);
|
||||||
_steps = ESteps.VerifyCacheFiles;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Progress = _verifyCacheFilesOp.Progress;
|
Progress = _verifyCacheFilesOp.Progress;
|
||||||
|
|||||||
@@ -124,19 +124,31 @@ namespace YooAsset
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取缓存的BundleFile文件夹路径
|
/// 获取缓存的BundleFile文件夹路径
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
private readonly static Dictionary<string, string> _cachedBundleFileFolder = new Dictionary<string, string>(100);
|
||||||
public static string GetCachedBundleFileFolderPath(string packageName)
|
public static string GetCachedBundleFileFolderPath(string packageName)
|
||||||
{
|
{
|
||||||
string root = PathHelper.MakePersistentLoadPath(CacheFolderName);
|
if (_cachedBundleFileFolder.TryGetValue(packageName, out string value) == false)
|
||||||
return $"{root}/{packageName}/{CachedBundleFileFolder}";
|
{
|
||||||
|
string root = PathHelper.MakePersistentLoadPath(CacheFolderName);
|
||||||
|
value = $"{root}/{packageName}/{CachedBundleFileFolder}";
|
||||||
|
_cachedBundleFileFolder.Add(packageName, value);
|
||||||
|
}
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取缓存的RawFile文件夹路径
|
/// 获取缓存的RawFile文件夹路径
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
private readonly static Dictionary<string, string> _cachedRawFileFolder = new Dictionary<string, string>(100);
|
||||||
public static string GetCachedRawFileFolderPath(string packageName)
|
public static string GetCachedRawFileFolderPath(string packageName)
|
||||||
{
|
{
|
||||||
string root = PathHelper.MakePersistentLoadPath(CacheFolderName);
|
if (_cachedRawFileFolder.TryGetValue(packageName, out string value) == false)
|
||||||
return $"{root}/{packageName}/{CachedRawFileFolder}";
|
{
|
||||||
|
string root = PathHelper.MakePersistentLoadPath(CacheFolderName);
|
||||||
|
value = $"{root}/{packageName}/{CachedRawFileFolder}";
|
||||||
|
_cachedRawFileFolder.Add(packageName, value);
|
||||||
|
}
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user