From 7e882357ecb4d3f6762b4f0db538bbf6907a9443 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 13 Nov 2024 17:10:23 +0800 Subject: [PATCH] [v3.8.5] Don't use private property '_files' in cache-manager.js. (#17846) --- cocos/asset/asset-manager/asset-manager.ts | 7 +++++++ platforms/minigame/common/engine/cache-manager.js | 2 +- platforms/runtime/common/engine/cache-manager.js | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/cocos/asset/asset-manager/asset-manager.ts b/cocos/asset/asset-manager/asset-manager.ts index e59e71ff836..b84002f1570 100644 --- a/cocos/asset/asset-manager/asset-manager.ts +++ b/cocos/asset/asset-manager/asset-manager.ts @@ -331,6 +331,13 @@ export class AssetManager { private constructor () {} + /** + * @engineInternal + */ + public get files(): Cache { + return this._files$; + } + /** * @engineInternal */ diff --git a/platforms/minigame/common/engine/cache-manager.js b/platforms/minigame/common/engine/cache-manager.js index 86a123a41f1..47963569751 100644 --- a/platforms/minigame/common/engine/cache-manager.js +++ b/platforms/minigame/common/engine/cache-manager.js @@ -191,7 +191,7 @@ const cacheManager = { } for (let i = 0, l = caches.length; i < l; i++) { const cacheKey = `${cc.assetManager.utils.getUuidFromURL(caches[i].originUrl)}@native`; - cc.assetManager._files.remove(cacheKey); + cc.assetManager.files.remove(cacheKey); this.cachedFiles.remove(caches[i].originUrl); } diff --git a/platforms/runtime/common/engine/cache-manager.js b/platforms/runtime/common/engine/cache-manager.js index 678e9fd0d12..bfba43897e4 100644 --- a/platforms/runtime/common/engine/cache-manager.js +++ b/platforms/runtime/common/engine/cache-manager.js @@ -184,7 +184,7 @@ const cacheManager = { } for (let i = 0, l = caches.length; i < l; i++) { const cacheKey = `${cc.assetManager.utils.getUuidFromURL(caches[i].originUrl)}@native`; - cc.assetManager._files.remove(cacheKey); + cc.assetManager.files.remove(cacheKey); this.cachedFiles.remove(caches[i].originUrl); }