Add clear unused cache files method.

增加清空缓存文件的方法。
This commit is contained in:
hevinci
2022-05-02 15:03:36 +08:00
parent 2c9819762a
commit 873d873194
12 changed files with 191 additions and 162 deletions

View File

@@ -675,22 +675,37 @@ namespace YooAsset
#region
/// <summary>
/// 清空沙盒目录
/// 注意:可以使用该方法修复我们本地的客户端
/// </summary>
public static void ClearSandbox()
{
YooLogger.Warning("Clear sandbox.");
SandboxHelper.ClearSandbox();
}
/// <summary>
/// 获取沙盒文件夹的路径
/// 获取沙盒的根路径
/// </summary>
public static string GetSandboxRoot()
{
return PathHelper.MakePersistentRootPath();
}
/// <summary>
/// 清空沙盒目录
/// </summary>
public static void ClearSandbox()
{
SandboxHelper.DeleteSandbox();
}
/// <summary>
/// 清空所有的缓存文件
/// </summary>
public static void ClearAllCacheFiles()
{
SandboxHelper.DeleteCacheFolder();
}
/// <summary>
/// 清空未被使用的缓存文件
/// </summary>
public static void ClearUnusedCacheFiles()
{
if (_playMode == EPlayMode.HostPlayMode)
_hostPlayModeImpl.ClearUnusedCacheFiles();
}
#endregion
#region