refactor: remove WebGame platform cache query APIs

移除 WebGame 平台缓存查询接口
This commit is contained in:
何冠峰
2026-05-21 14:34:07 +08:00
parent 2f8355c3f4
commit 99b975554a
6 changed files with 1 additions and 80 deletions

View File

@@ -28,20 +28,5 @@ namespace YooAsset
/// <param name="assetBundle">待卸载的 AssetBundle 实例</param>
/// <param name="unloadAll">是否同时卸载所有已加载的资源对象</param>
void UnloadAssetBundle(AssetBundle assetBundle, bool unloadAll);
/// <summary>
/// 检查指定资源包是否已在平台缓存中
/// </summary>
/// <param name="cacheFilePath">资源包在本地缓存中的文件路径</param>
/// <returns>如果已缓存则返回 true否则返回 false。</returns>
bool IsCached(string cacheFilePath);
/// <summary>
/// 获取资源包在平台缓存中的文件路径
/// </summary>
/// <param name="rootPath">缓存根目录</param>
/// <param name="bundle">资源包描述</param>
/// <returns>缓存文件的完整路径</returns>
string GetCacheFilePath(string rootPath, PackageBundle bundle);
}
}

View File

@@ -28,17 +28,5 @@ internal class AlipayPlatform : IWebGamePlatform
{
assetBundle.APUnload(unloadAll);
}
/// <inheritdoc/>
public bool IsCached(string cacheFilePath)
{
return false;
}
/// <inheritdoc/>
public string GetCacheFilePath(string rootPath, PackageBundle bundle)
{
return PathUtility.Combine(rootPath, bundle.GetFileName());
}
}
#endif

View File

@@ -28,17 +28,5 @@ internal class TaptapPlatform : IWebGamePlatform
{
assetBundle.TapUnload(unloadAll);
}
/// <inheritdoc/>
public bool IsCached(string cacheFilePath)
{
return false;
}
/// <inheritdoc/>
public string GetCacheFilePath(string rootPath, PackageBundle bundle)
{
return PathUtility.Combine(rootPath, bundle.GetFileName());
}
}
#endif

View File

@@ -1,6 +1,5 @@
#if UNITY_WEBGL && DOUYINMINIGAME
using YooAsset;
using TTSDK;
public static class TiktokFileSystemCreater
{
@@ -29,7 +28,7 @@ internal class TiktokFileSystem : WebGameFileSystem
/// <inheritdoc/>
protected override IWebGamePlatform CreatePlatform(string packageRoot)
{
return new TiktokPlatform(TT.GetFileSystemManager());
return new TiktokPlatform();
}
}
#endif

View File

@@ -9,17 +9,6 @@ using TTSDK;
/// </summary>
internal class TiktokPlatform : IWebGamePlatform
{
private readonly TTFileSystemManager _fileSystemMgr;
/// <summary>
/// 创建 TiktokPlatform 实例
/// </summary>
/// <param name="fileSystemMgr">抖音文件系统管理器</param>
internal TiktokPlatform(TTFileSystemManager fileSystemMgr)
{
_fileSystemMgr = fileSystemMgr;
}
/// <inheritdoc/>
public UnityWebRequest CreateAssetBundleRequest(string url)
{
@@ -38,17 +27,5 @@ internal class TiktokPlatform : IWebGamePlatform
{
assetBundle.TTUnload(unloadAll);
}
/// <inheritdoc/>
public bool IsCached(string cacheFilePath)
{
return false;
}
/// <inheritdoc/>
public string GetCacheFilePath(string rootPath, PackageBundle bundle)
{
return _fileSystemMgr.GetLocalCachedPathForUrl(bundle.GetFileName());
}
}
#endif

View File

@@ -27,21 +27,5 @@ internal class WechatPlatform : IWebGamePlatform
{
assetBundle.WXUnload(unloadAll);
}
/// <inheritdoc/>
public bool IsCached(string cacheFilePath)
{
if (string.IsNullOrEmpty(cacheFilePath))
return false;
string result = WX.GetCachePath(cacheFilePath);
return string.IsNullOrEmpty(result) == false;
}
/// <inheritdoc/>
public string GetCacheFilePath(string rootPath, PackageBundle bundle)
{
return PathUtility.Combine(rootPath, bundle.GetFileName());
}
}
#endif