update patch system

初始化的时候检测覆盖安装
This commit is contained in:
hevinci
2022-12-13 11:29:22 +08:00
parent 889000d8a8
commit d67fc31c26
2 changed files with 89 additions and 2 deletions

View File

@@ -84,6 +84,8 @@ namespace YooAsset
internal static class PersistentHelper
{
private const string CacheFolderName = "CacheFiles";
private const string ManifestFolderName = "ManifestFiles";
private const string AppFootPrintFileName = "ApplicationFootPrint.bytes";
/// <summary>
/// 删除沙盒总目录
@@ -105,6 +107,16 @@ namespace YooAsset
Directory.Delete(root, true);
}
/// <summary>
/// 删除沙盒内的清单文件夹
/// </summary>
public static void DeleteManifestFolder()
{
string root = PathHelper.MakePersistentLoadPath(ManifestFolderName);
if (Directory.Exists(root))
Directory.Delete(root, true);
}
/// <summary>
/// 获取缓存文件夹路径
/// </summary>
@@ -114,6 +126,14 @@ namespace YooAsset
return $"{root}/{packageName}";
}
/// <summary>
/// 获取应用程序的水印文件路径
/// </summary>
public static string GetAppFootPrintFilePath()
{
return PathHelper.MakePersistentLoadPath(AppFootPrintFileName);
}
#region
/// <summary>
/// 获取沙盒内清单文件的路径
@@ -121,7 +141,7 @@ namespace YooAsset
public static string GetCacheManifestFilePath(string packageName)
{
string fileName = YooAssetSettingsData.GetPatchManifestFileNameWithoutVersion(packageName);
return PathHelper.MakePersistentLoadPath(fileName);
return PathHelper.MakePersistentLoadPath($"{ManifestFolderName}/{fileName}");
}
/// <summary>