From ee3b5b9d764695e87d791bd56c3d8dc5ad49fb47 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 13 Nov 2024 14:53:37 +0800 Subject: [PATCH 1/2] [v3.8.5] Don't use private properties in cache-manager.js. Add an internal getter for it. --- 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..c449075343f 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() { + 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); } From 23fe641251563b141b95f832673febeae3bd8497 Mon Sep 17 00:00:00 2001 From: James Chen Date: Wed, 13 Nov 2024 15:18:44 +0800 Subject: [PATCH 2/2] Update asset-manager.ts --- cocos/asset/asset-manager/asset-manager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/asset/asset-manager/asset-manager.ts b/cocos/asset/asset-manager/asset-manager.ts index c449075343f..b84002f1570 100644 --- a/cocos/asset/asset-manager/asset-manager.ts +++ b/cocos/asset/asset-manager/asset-manager.ts @@ -334,7 +334,7 @@ export class AssetManager { /** * @engineInternal */ - public get files() { + public get files(): Cache { return this._files$; }