From 13364c0c627b28ba416db08ff6ffb44e6ff234f7 Mon Sep 17 00:00:00 2001 From: SmallMain Date: Tue, 22 Oct 2024 17:17:13 +0800 Subject: [PATCH] =?UTF-8?q?[adapters]=20=E5=85=BC=E5=AE=B9=20iOS=E3=80=81W?= =?UTF-8?q?in=E3=80=81Mac=20=E4=B8=8A=E5=A4=9A=E7=BA=BF=E7=A8=8B=E9=83=A8?= =?UTF-8?q?=E5=88=86=20Api=20=E6=97=A0=E6=B3=95=E4=BD=BF=E7=94=A8=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adapters/platforms/wechat/res/worker_adapter/macro.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/adapters/platforms/wechat/res/worker_adapter/macro.js b/adapters/platforms/wechat/res/worker_adapter/macro.js index 306a6a8e..bda96acf 100644 --- a/adapters/platforms/wechat/res/worker_adapter/macro.js +++ b/adapters/platforms/wechat/res/worker_adapter/macro.js @@ -1,7 +1,7 @@ const isSubContext = wx.getOpenDataContext === undefined; const sysinfo = wx.getSystemInfoSync(); const platform = sysinfo.platform.toLowerCase(); -const isIOS = platform === "ios"; +const isAndroid = platform === "android"; const sdkVersion = sysinfo.SDKVersion.split('.').map(Number); // >= 2.20.2 const hasWorker = sdkVersion[0] > 2 || (sdkVersion[0] === 2 && (sdkVersion[1] > 20 || (sdkVersion[1] === 20 && sdkVersion[2] >= 2))); @@ -12,6 +12,9 @@ globalThis.CC_WORKER_ASSET_PIPELINE = false; // 是否启用 Worker 驱动资源管线(加载) globalThis.CC_WORKER_ASSET_PIPELINE_INCLUDE_LOAD = false; +// NOTE 截止 2024.10.22,微信未修复 iOS、Windows、Mac 上仅文件系统 API 可以正常使用的问题 +globalThis.CC_WORKER_ASSET_PIPELINE = isAndroid && globalThis.CC_WORKER_ASSET_PIPELINE; + // 是否启用 Worker globalThis.CC_USE_WORKER = (CC_WORKER_ASSET_PIPELINE) && hasWorker && !isSubContext; @@ -22,5 +25,5 @@ globalThis.CC_WORKER_DEBUG = false; globalThis.CC_WORKER_SCHEDULER = true; // 是否启用 Worker 使用同步版本的文件系统 API -// NOTE: IOS 不支持 async 文件系统 API,Android 不支持部分 sync 文件系统 API -globalThis.CC_WORKER_FS_SYNC = isIOS; +// NOTE: IOS 不支持 async 文件系统 API,Android 不支持部分 sync 文件系统 API,其余系统暂不确定 +globalThis.CC_WORKER_FS_SYNC = !isAndroid;