mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-27 03:00:17 +00:00
refactor: remove WebGame platform cache query APIs
移除 WebGame 平台缓存查询接口
This commit is contained in:
@@ -28,20 +28,5 @@ namespace YooAsset
|
|||||||
/// <param name="assetBundle">待卸载的 AssetBundle 实例</param>
|
/// <param name="assetBundle">待卸载的 AssetBundle 实例</param>
|
||||||
/// <param name="unloadAll">是否同时卸载所有已加载的资源对象</param>
|
/// <param name="unloadAll">是否同时卸载所有已加载的资源对象</param>
|
||||||
void UnloadAssetBundle(AssetBundle assetBundle, bool unloadAll);
|
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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,17 +28,5 @@ internal class AlipayPlatform : IWebGamePlatform
|
|||||||
{
|
{
|
||||||
assetBundle.APUnload(unloadAll);
|
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
|
#endif
|
||||||
|
|||||||
@@ -28,17 +28,5 @@ internal class TaptapPlatform : IWebGamePlatform
|
|||||||
{
|
{
|
||||||
assetBundle.TapUnload(unloadAll);
|
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
|
#endif
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#if UNITY_WEBGL && DOUYINMINIGAME
|
#if UNITY_WEBGL && DOUYINMINIGAME
|
||||||
using YooAsset;
|
using YooAsset;
|
||||||
using TTSDK;
|
|
||||||
|
|
||||||
public static class TiktokFileSystemCreater
|
public static class TiktokFileSystemCreater
|
||||||
{
|
{
|
||||||
@@ -29,7 +28,7 @@ internal class TiktokFileSystem : WebGameFileSystem
|
|||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
protected override IWebGamePlatform CreatePlatform(string packageRoot)
|
protected override IWebGamePlatform CreatePlatform(string packageRoot)
|
||||||
{
|
{
|
||||||
return new TiktokPlatform(TT.GetFileSystemManager());
|
return new TiktokPlatform();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -9,17 +9,6 @@ using TTSDK;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
internal class TiktokPlatform : IWebGamePlatform
|
internal class TiktokPlatform : IWebGamePlatform
|
||||||
{
|
{
|
||||||
private readonly TTFileSystemManager _fileSystemMgr;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 创建 TiktokPlatform 实例
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="fileSystemMgr">抖音文件系统管理器</param>
|
|
||||||
internal TiktokPlatform(TTFileSystemManager fileSystemMgr)
|
|
||||||
{
|
|
||||||
_fileSystemMgr = fileSystemMgr;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public UnityWebRequest CreateAssetBundleRequest(string url)
|
public UnityWebRequest CreateAssetBundleRequest(string url)
|
||||||
{
|
{
|
||||||
@@ -38,17 +27,5 @@ internal class TiktokPlatform : IWebGamePlatform
|
|||||||
{
|
{
|
||||||
assetBundle.TTUnload(unloadAll);
|
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
|
#endif
|
||||||
|
|||||||
@@ -27,21 +27,5 @@ internal class WechatPlatform : IWebGamePlatform
|
|||||||
{
|
{
|
||||||
assetBundle.WXUnload(unloadAll);
|
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
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user