diff --git a/CHANGELOG.md b/CHANGELOG.md index e10a8861..2f9307a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,7 @@ Removed - 删除功能/接口 Fixed - 修复问题 Others - 其他 --> -## 2024-8-28 【预发布】 -PackageManager(git URL): https://github.com/wechat-miniprogram/minigame-tuanjie-transform-sdk.git#pre-v0.1.19 +## 2024-10-8 【重要更新】 ### Feature * 普通: UDPSocket.write适配 * 普通: 部分JS API接口更新 @@ -15,6 +14,11 @@ PackageManager(git URL): https://github.com/wechat-miniprogram/minigame-tuanjie- ### Fixed * 普通: 修复.net8 OnApplicationFocus/Pause适配 * 普通: 修复插件自动调节dpr后,获取不到实际dpr +* 普通:修复音频设置timeSamples不生效 +* 重要: 修复iOS18微信系统字体丢失 +* 重要:修复10S17.5以上音频退后台无法恢复 +* 重要:修复音频PC端异常循环播 +* 重要: 修复游戏圈文案默认显示'打开游戏圈'的问题 ## 2024-8-13 【重要更新】 ### Feature diff --git a/Editor/WXAssetPostprocessor.cs b/Editor/WXAssetPostprocessor.cs index af64c8cf..fcc48d9b 100644 --- a/Editor/WXAssetPostprocessor.cs +++ b/Editor/WXAssetPostprocessor.cs @@ -2,6 +2,7 @@ using UnityEditor; using System; using System.Reflection; using System.IO; +/* public class WXAssetPostprocessor : AssetPostprocessor { private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) @@ -177,3 +178,4 @@ public class WXAssetPostprocessor : AssetPostprocessor return enabledStrIdx + 9; } } +*/ \ No newline at end of file diff --git a/Editor/WXConvertCore.cs b/Editor/WXConvertCore.cs index 02b268da..953a2c20 100644 --- a/Editor/WXConvertCore.cs +++ b/Editor/WXConvertCore.cs @@ -118,7 +118,7 @@ namespace WeChatWASM CheckBuildTarget(); Init(); - ProcessWxPerfBinaries(); + ProcessWxPerfBinaries(); // JSLib SettingWXTextureMinJSLib(); UpdateGraphicAPI(); @@ -242,7 +242,40 @@ namespace WeChatWASM }; } - WXAssetPostprocessor.EnableWXPostProcess = config.CompileOptions.enablePerfAnalysis; + { + // WxPerfJsBridge.jslib + var wxPerfJSBridgeImporter = AssetImporter.GetAtPath(wxPerfPlugins[0]) as PluginImporter; +#if PLATFORM_WEIXINMINIGAME + wxPerfJSBridgeImporter.SetCompatibleWithPlatform(BuildTarget.WeixinMiniGame, config.CompileOptions.enablePerfAnalysis); +#else + wxPerfJSBridgeImporter.SetCompatibleWithPlatform(BuildTarget.WebGL, config.CompileOptions.enablePerfAnalysis); +#endif + } + + { + // wx_perf_2022.a + bool bShouldEnablePerf2022Plugin = config.CompileOptions.enablePerfAnalysis && IsCompatibleWithUnity202203OrNewer(); + + var wxPerf2022Importer = AssetImporter.GetAtPath(wxPerfPlugins[1]) as PluginImporter; +#if PLATFORM_WEIXINMINIGAME + wxPerf2022Importer.SetCompatibleWithPlatform(BuildTarget.WeixinMiniGame, bShouldEnablePerf2022Plugin); +#else + wxPerf2022Importer.SetCompatibleWithPlatform(BuildTarget.WebGL, bShouldEnablePerf2022Plugin); +#endif + } + + { + // wx_perf_2021.a + bool bShouldEnablePerf2021Plugin = config.CompileOptions.enablePerfAnalysis && IsCompatibleWithUnity202103To202203(); + + var wxPerf2021Importer = AssetImporter.GetAtPath(wxPerfPlugins[2]) as PluginImporter; +#if PLATFORM_WEIXINMINIGAME + wxPerf2021Importer.SetCompatibleWithPlatform(BuildTarget.WeixinMiniGame, bShouldEnablePerf2021Plugin); +#else + wxPerf2021Importer.SetCompatibleWithPlatform(BuildTarget.WebGL, bShouldEnablePerf2021Plugin); +#endif + } + for (int i = 0; i < wxPerfPlugins.Length; i++) { var importer = AssetImporter.GetAtPath(wxPerfPlugins[i]) as PluginImporter; @@ -252,6 +285,27 @@ namespace WeChatWASM } } + private static bool IsCompatibleWithUnity202203OrNewer() + { +#if UNITY_2022_3_OR_NEWER + return true; +#endif + return false; + } + + static bool IsCompatibleWithUnity202103To202203() + { +#if UNITY_2022_3_OR_NEWER + return false; +#endif + +#if !UNITY_2021_3_OR_NEWER + return false; +#endif + + return true; + } + private static void CheckBuildTarget() { Emit(LifeCycle.beforeSwitchActiveBuildTarget); @@ -368,8 +422,8 @@ namespace WeChatWASM { const string MACRO_ENABLE_WX_PERF_FEATURE = "ENABLE_WX_PERF_FEATURE"; string defineSymbols = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup); - - return (!config.CompileOptions.DevelopBuild) && (defineSymbols.IndexOf(MACRO_ENABLE_WX_PERF_FEATURE) != -1); + + return (!config.CompileOptions.DevelopBuild) && (defineSymbols.IndexOf(MACRO_ENABLE_WX_PERF_FEATURE) != -1); } private static void ConvertDotnetCode() @@ -1378,10 +1432,10 @@ namespace WeChatWASM } catch (Exception e) { - Debug.LogWarning("[可选]生成Boot info 失败!错误:" + e.Message); + Debug.LogWarning("[可选]生成Boot info 失败!错误:" + e.Message); } - + return sb.ToString(); } @@ -1464,9 +1518,9 @@ namespace WeChatWASM config.FontOptions.Mathematical_Operators ? "true" : "false", customUnicodeRange, boolConfigInfo, - config.CompileOptions.DevelopBuild ? "true" : "false", - config.CompileOptions.enablePerfAnalysis ? "true" : "false", - config.ProjectConf.MemorySize.ToString(), + config.CompileOptions.DevelopBuild ? "true" : "false", + config.CompileOptions.enablePerfAnalysis ? "true" : "false", + config.ProjectConf.MemorySize.ToString(), }); List replaceList = new List(replaceArrayList); diff --git a/Editor/WXEditorSettingHelper.cs b/Editor/WXEditorSettingHelper.cs index c14a3c06..dde0d0b3 100644 --- a/Editor/WXEditorSettingHelper.cs +++ b/Editor/WXEditorSettingHelper.cs @@ -59,7 +59,7 @@ namespace WeChatWASM } private static WXEditorScriptObject config; - private static bool m_EnablePerfTool = false; + private static bool m_EnablePerfTool = false; private static string _dstCache; @@ -206,7 +206,7 @@ namespace WeChatWASM { this.formCheckbox("enablePerfAnalysis", "集成性能分析工具", "将性能分析工具集成入Development Build包中", false, null, OnPerfAnalysisFeatureToggleChanged); } - + EditorGUILayout.EndVertical(); } @@ -470,7 +470,7 @@ namespace WeChatWASM this.setData("enableProfileStats", config.CompileOptions.enableProfileStats); this.setData("enableRenderAnalysis", config.CompileOptions.enableRenderAnalysis); this.setData("brotliMT", config.CompileOptions.brotliMT); - this.setData("enablePerfAnalysis", config.CompileOptions.enablePerfAnalysis); + this.setData("enablePerfAnalysis", config.CompileOptions.enablePerfAnalysis); this.setData("autoUploadFirstBundle", true); // font options @@ -565,7 +565,7 @@ namespace WeChatWASM config.FontOptions.Mathematical_Operators = this.getDataCheckbox("Mathematical_Operators"); config.FontOptions.CustomUnicode = this.getDataInput("CustomUnicode"); - ApplyPerfAnalysisSetting(); + ApplyPerfAnalysisSetting(); } private string getDataInput(string target) @@ -703,7 +703,7 @@ namespace WeChatWASM // 针对non-dev build,取消性能分析工具的集成 if (!InNewValue) { - this.setData("enablePerfAnalysis", false); + this.setData("enablePerfAnalysis", false); } } @@ -712,7 +712,7 @@ namespace WeChatWASM // 针对non-dev build,取消性能分析工具的集成 if (!formCheckboxData["developBuild"] && InNewValue) { - this.setData("enablePerfAnalysis", false); + this.setData("enablePerfAnalysis", false); } } @@ -720,7 +720,7 @@ namespace WeChatWASM { const string MACRO_ENABLE_WX_PERF_FEATURE = "ENABLE_WX_PERF_FEATURE"; string defineSymbols = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup); - if (this.getDataCheckbox("enablePerfAnalysis") && this.getDataCheckbox("developBuild")) + if (this.getDataCheckbox("enablePerfAnalysis") && this.getDataCheckbox("developBuild")) { if (defineSymbols.IndexOf(MACRO_ENABLE_WX_PERF_FEATURE) == -1) { @@ -767,7 +767,7 @@ namespace WeChatWASM { return path; } - + return Path.Combine(projectRootPath, path); } } diff --git a/Editor/WXPluginVersion.cs b/Editor/WXPluginVersion.cs index 6bc77458..f94f092f 100644 --- a/Editor/WXPluginVersion.cs +++ b/Editor/WXPluginVersion.cs @@ -2,7 +2,7 @@ { public class WXPluginVersion { - public static string pluginVersion = "202409231305"; // 这一行不要改他,导出的时候会自动替换 + public static string pluginVersion = "202410090312"; // 这一行不要改他,导出的时候会自动替换 } public class WXPluginConf diff --git a/Editor/wx-editor.dll b/Editor/wx-editor.dll index 5ba4052c..4e7a7e8b 100644 Binary files a/Editor/wx-editor.dll and b/Editor/wx-editor.dll differ diff --git a/Editor/wx-editor.xml.meta b/Editor/wx-editor.xml.meta index bb2b0e67..ef6965a1 100644 --- a/Editor/wx-editor.xml.meta +++ b/Editor/wx-editor.xml.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 7b8f90f41107e40046b2e6e4390b7940 +guid: ea573b7c76b8aac5ab5186e02fe04d13 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/Plugins.meta b/Runtime/Plugins.meta index ed00fb1e..8b29380b 100644 --- a/Runtime/Plugins.meta +++ b/Runtime/Plugins.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 7f9a0d6ca72d248589c57ea4377d485c +guid: 3c175baca80544c4e90798ccfced6c83 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/Plugins/SDK-Call-JS-Old.jslib b/Runtime/Plugins/SDK-Call-JS-Old.jslib index f8675ae2..c266cb4a 100755 --- a/Runtime/Plugins/SDK-Call-JS-Old.jslib +++ b/Runtime/Plugins/SDK-Call-JS-Old.jslib @@ -30,7 +30,7 @@ mergeInto(LibraryManager.library, { GameGlobal.memprofiler = emscriptenMemoryProfiler GameGlobal.memprofiler.onDump = function () { var fs = wx.getFileSystemManager(); - var allocation_used=GameGlobal.memprofiler.allocationsAtLoc; + var allocation_used = GameGlobal.memprofiler.allocationsAtLoc; if (typeof allocation_used === "undefined") allocation_used=GameGlobal.memprofiler.allocationSiteStatistics; var calls = []; for (var i in allocation_used) { diff --git a/Runtime/Plugins/SDK-Call-JS.jslib b/Runtime/Plugins/SDK-Call-JS.jslib index 17a85e0b..86495b1b 100644 --- a/Runtime/Plugins/SDK-Call-JS.jslib +++ b/Runtime/Plugins/SDK-Call-JS.jslib @@ -176,6 +176,9 @@ WX_Login:function(conf, callbackId) { WX_MakeBluetoothPair:function(conf, callbackId) { window.WXWASMSDK.WX_MakeBluetoothPair(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); }, +WX_NavigateBackMiniProgram:function(conf, callbackId) { + window.WXWASMSDK.WX_NavigateBackMiniProgram(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); +}, WX_NavigateToMiniProgram:function(conf, callbackId) { window.WXWASMSDK.WX_NavigateToMiniProgram(_WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId)); }, @@ -408,6 +411,9 @@ WX_OpenBusinessView:function(conf, callbackId) { WX_ExitPointerLock:function() { window.WXWASMSDK.WX_ExitPointerLock(); }, +WX_GetPhoneNumber:function(option){ + window.WXWASMSDK.WX_GetPhoneNumber(_WXPointer_stringify_adaptor(option)); +}, WX_OperateGameRecorderVideo:function(option){ window.WXWASMSDK.WX_OperateGameRecorderVideo(_WXPointer_stringify_adaptor(option)); }, diff --git a/Runtime/Plugins/wx-perf.dll b/Runtime/Plugins/wx-perf.dll index e42ac50e..0c794fec 100644 Binary files a/Runtime/Plugins/wx-perf.dll and b/Runtime/Plugins/wx-perf.dll differ diff --git a/Runtime/Plugins/wx-runtime-editor.dll b/Runtime/Plugins/wx-runtime-editor.dll index 2e4db91d..4d77a5fc 100644 Binary files a/Runtime/Plugins/wx-runtime-editor.dll and b/Runtime/Plugins/wx-runtime-editor.dll differ diff --git a/Runtime/Plugins/wx-runtime-editor.xml b/Runtime/Plugins/wx-runtime-editor.xml index cd7cc8de..47926c8b 100644 --- a/Runtime/Plugins/wx-runtime-editor.xml +++ b/Runtime/Plugins/wx-runtime-editor.xml @@ -3124,7 +3124,7 @@ - 允许微信使用蓝牙的开关(仅 iOS 有效) + 允许微信使用蓝牙的开关(安卓基础库 3.5.0 以上有效) @@ -5829,8 +5829,10 @@ 直播状态 可选值: + - 1: 直播状态不存在(针对未开过直播的主播); - 2: 直播中; - - 3: 直播结束; + - 3: 直播已结束; + - 4: 直播准备中(未开播); @@ -6207,6 +6209,22 @@ 信号强弱,单位 dbm + + + 需要基础库: `3.5.3` + 是否处于弱网环境 + + + + + 手机号实时验证,向用户申请,并在用户同意后,快速填写和实时验证手机号 [具体说明](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/getRealtimePhoneNumber.html)。 + + + + + 当手机号快速验证或手机号实时验证额度用尽时,是否对用户展示“申请获取你的手机号,但该功能使用次数已达当前小程序上限,暂时无法使用”的提示,默认展示。 + + 接口调用结束的回调函数(调用成功、失败都会执行) @@ -6224,7 +6242,7 @@ - 是否需要用户授权隐私协议(如果开发者没有在[mp后台-设置-服务内容声明-用户隐私保护指引]中声明隐私收集类型则会返回false;如果开发者声明了隐私收集,且用户之前同意过隐私协议则会返回false;如果开发者声明了隐私收集,且用户还没同意过则返回true;如果用户之前同意过、但后来小程序又新增了隐私收集类型也会返回true) + 是否需要用户授权隐私协议(如果开发者没有在「MP后台-设置-服务内容声明-用户隐私保护指引」中声明隐私收集类型则会返回false;如果开发者声明了隐私收集,且用户之前同意过隐私协议则会返回false;如果开发者声明了隐私收集,且用户还没同意过则返回true;如果用户之前同意过、但后来小程序又新增了隐私收集类型也会返回true) @@ -6876,6 +6894,26 @@ 超时时间,单位 ms + + + 接口调用结束的回调函数(调用成功、失败都会执行) + + + + + 需要返回给上一个小程序的数据,上一个小程序可在 `App.onShow` 中获取到这份数据。 [详情](#)。 + + + + + 接口调用失败的回调函数 + + + + + 接口调用成功的回调函数 + + 要打开的小程序 appId @@ -8331,7 +8369,11 @@ | -15009 | | 虚拟支付接口错误码,由于健康系统限制,本次支付已超过限额(这种错误情况会有默认弹窗提示) | | -15010 | | 虚拟支付接口错误码,正式版小游戏不允许在沙箱环境支付 | | -15011 | | 请求的数据类型错误 | + | -15012 | | SIGNATURE错误 | | -15013 | | 代币未发布 | + | -15014 | | paysig错误 | + | -15015 | | sessionkey过期 | + | -15016 | | 道具价格错误 | | -15017 | | 订单已关闭 | | 1 | | 虚拟支付接口错误码,用户取消支付 | | 2 | | 虚拟支付接口错误码,客户端错误,判断到小程序在用户处于支付中时,又发起了一笔支付请求 | @@ -8365,7 +8407,11 @@ | -15009 | | 虚拟支付接口错误码,由于健康系统限制,本次支付已超过限额(这种错误情况会有默认弹窗提示) | | -15010 | | 虚拟支付接口错误码,正式版小游戏不允许在沙箱环境支付 | | -15011 | | 请求的数据类型错误 | + | -15012 | | SIGNATURE错误 | | -15013 | | 代币未发布 | + | -15014 | | paysig错误 | + | -15015 | | sessionkey过期 | + | -15016 | | 道具价格错误 | | -15017 | | 订单已关闭 | | 1 | | 虚拟支付接口错误码,用户取消支付 | | 2 | | 虚拟支付接口错误码,客户端错误,判断到小程序在用户处于支付中时,又发起了一笔支付请求 | @@ -9252,7 +9298,7 @@ 需要基础库: `3.2.0` - 分享样式,可选 v2 + 分享样式,小程序可选 v2 diff --git a/Runtime/Plugins/wx-runtime-editor.xml.meta b/Runtime/Plugins/wx-runtime-editor.xml.meta index a658cc19..0088c79d 100644 --- a/Runtime/Plugins/wx-runtime-editor.xml.meta +++ b/Runtime/Plugins/wx-runtime-editor.xml.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 18f2f2679ed16c0971d074086314105d +guid: 35abec2d15f2b451d22c7d720dec24d6 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/Plugins/wx-runtime.dll b/Runtime/Plugins/wx-runtime.dll index c82acd95..5f93b5d4 100644 Binary files a/Runtime/Plugins/wx-runtime.dll and b/Runtime/Plugins/wx-runtime.dll differ diff --git a/Runtime/Plugins/wx-runtime.xml b/Runtime/Plugins/wx-runtime.xml index 052c8601..48004165 100644 --- a/Runtime/Plugins/wx-runtime.xml +++ b/Runtime/Plugins/wx-runtime.xml @@ -3130,7 +3130,7 @@ - 允许微信使用蓝牙的开关(仅 iOS 有效) + 允许微信使用蓝牙的开关(安卓基础库 3.5.0 以上有效) @@ -5835,8 +5835,10 @@ 直播状态 可选值: + - 1: 直播状态不存在(针对未开过直播的主播); - 2: 直播中; - - 3: 直播结束; + - 3: 直播已结束; + - 4: 直播准备中(未开播); @@ -6213,6 +6215,22 @@ 信号强弱,单位 dbm + + + 需要基础库: `3.5.3` + 是否处于弱网环境 + + + + + 手机号实时验证,向用户申请,并在用户同意后,快速填写和实时验证手机号 [具体说明](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/getRealtimePhoneNumber.html)。 + + + + + 当手机号快速验证或手机号实时验证额度用尽时,是否对用户展示“申请获取你的手机号,但该功能使用次数已达当前小程序上限,暂时无法使用”的提示,默认展示。 + + 接口调用结束的回调函数(调用成功、失败都会执行) @@ -6230,7 +6248,7 @@ - 是否需要用户授权隐私协议(如果开发者没有在[mp后台-设置-服务内容声明-用户隐私保护指引]中声明隐私收集类型则会返回false;如果开发者声明了隐私收集,且用户之前同意过隐私协议则会返回false;如果开发者声明了隐私收集,且用户还没同意过则返回true;如果用户之前同意过、但后来小程序又新增了隐私收集类型也会返回true) + 是否需要用户授权隐私协议(如果开发者没有在「MP后台-设置-服务内容声明-用户隐私保护指引」中声明隐私收集类型则会返回false;如果开发者声明了隐私收集,且用户之前同意过隐私协议则会返回false;如果开发者声明了隐私收集,且用户还没同意过则返回true;如果用户之前同意过、但后来小程序又新增了隐私收集类型也会返回true) @@ -6882,6 +6900,26 @@ 超时时间,单位 ms + + + 接口调用结束的回调函数(调用成功、失败都会执行) + + + + + 需要返回给上一个小程序的数据,上一个小程序可在 `App.onShow` 中获取到这份数据。 [详情](#)。 + + + + + 接口调用失败的回调函数 + + + + + 接口调用成功的回调函数 + + 要打开的小程序 appId @@ -8337,7 +8375,11 @@ | -15009 | | 虚拟支付接口错误码,由于健康系统限制,本次支付已超过限额(这种错误情况会有默认弹窗提示) | | -15010 | | 虚拟支付接口错误码,正式版小游戏不允许在沙箱环境支付 | | -15011 | | 请求的数据类型错误 | + | -15012 | | SIGNATURE错误 | | -15013 | | 代币未发布 | + | -15014 | | paysig错误 | + | -15015 | | sessionkey过期 | + | -15016 | | 道具价格错误 | | -15017 | | 订单已关闭 | | 1 | | 虚拟支付接口错误码,用户取消支付 | | 2 | | 虚拟支付接口错误码,客户端错误,判断到小程序在用户处于支付中时,又发起了一笔支付请求 | @@ -8371,7 +8413,11 @@ | -15009 | | 虚拟支付接口错误码,由于健康系统限制,本次支付已超过限额(这种错误情况会有默认弹窗提示) | | -15010 | | 虚拟支付接口错误码,正式版小游戏不允许在沙箱环境支付 | | -15011 | | 请求的数据类型错误 | + | -15012 | | SIGNATURE错误 | | -15013 | | 代币未发布 | + | -15014 | | paysig错误 | + | -15015 | | sessionkey过期 | + | -15016 | | 道具价格错误 | | -15017 | | 订单已关闭 | | 1 | | 虚拟支付接口错误码,用户取消支付 | | 2 | | 虚拟支付接口错误码,客户端错误,判断到小程序在用户处于支付中时,又发起了一笔支付请求 | @@ -9258,7 +9304,7 @@ 需要基础库: `3.2.0` - 分享样式,可选 v2 + 分享样式,小程序可选 v2 diff --git a/Runtime/Plugins/wx-runtime.xml.meta b/Runtime/Plugins/wx-runtime.xml.meta index 51f1c462..e677d3b0 100644 --- a/Runtime/Plugins/wx-runtime.xml.meta +++ b/Runtime/Plugins/wx-runtime.xml.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: bcb487e94186775baeab1023fec55a0f +guid: ce7cb455607c44b239150fa3ffb93fa4 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/WX.cs b/Runtime/WX.cs index 046d53e3..195185ef 100644 --- a/Runtime/WX.cs +++ b/Runtime/WX.cs @@ -719,6 +719,7 @@ namespace WeChatWASM /// wx.getNetworkType({ /// success (res) { /// const networkType = res.networkType + /// const weakNet = res.weakNet /// } /// }) /// ``` @@ -1143,6 +1144,28 @@ namespace WeChatWASM WXSDKManagerHandler.Instance.MakeBluetoothPair(callback); } + /// + /// [wx.navigateBackMiniProgram(Object object)](https://developers.weixin.qq.com/minigame/dev/api/navigate/wx.navigateBackMiniProgram.html) + /// 需要基础库: `3.5.6` + /// 返回到上一个小程序。只有在当前小程序是被其他小程序打开时可以调用成功。 + /// 注意:**微信客户端 iOS 6.5.9,Android 6.5.10 及以上版本支持** + /// **示例代码** + /// ```js + /// wx.navigateBackMiniProgram({ + /// extraData: { + /// foo: 'bar' + /// }, + /// success(res) { + /// // 返回成功 + /// } + /// }) + /// ``` + /// + public static void NavigateBackMiniProgram(NavigateBackMiniProgramOption callback) + { + WXSDKManagerHandler.Instance.NavigateBackMiniProgram(callback); + } + /// /// [wx.navigateToMiniProgram(Object object)](https://developers.weixin.qq.com/minigame/dev/api/navigate/wx.navigateToMiniProgram.html) /// 需要基础库: `2.2.0` @@ -1422,11 +1445,11 @@ namespace WeChatWASM /// | 类型 | 说明 | 最低版本 | /// |------|------| -------| /// | 小程序码 | | - /// | 微信个人码 | 不支持小游戏 | [2.18.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) | - /// | 企业微信个人码 | 不支持小游戏 | [2.18.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) | - /// | 普通群码 | 指仅包含微信用户的群,不支持小游戏 | [2.18.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) | - /// | 互通群码 | 指既有微信用户也有企业微信用户的群,不支持小游戏 | [2.18.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) | - /// | 公众号二维码 | 不支持小游戏 | [2.18.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) | + /// | 微信个人码 | | [2.18.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) | + /// | 企业微信个人码 | | [2.18.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) | + /// | 普通群码 | 指仅包含微信用户的群 | [2.18.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) | + /// | 互通群码 | 指既有微信用户也有企业微信用户的群 | [2.18.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) | + /// | 公众号二维码 | | [2.18.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) | /// **示例代码** /// ```js /// wx.previewImage({ @@ -1569,8 +1592,7 @@ namespace WeChatWASM /// /// [wx.requestMidasPayment(Object object)](https://developers.weixin.qq.com/minigame/dev/api/midas-payment/wx.requestMidasPayment.html) /// 需要基础库: `2.19.2` - /// 发起购买游戏币支付请求,可参考[虚拟支付2.0游戏币](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/virtual-payment/coins.html) - /// 虚拟支付全流程可参考[技术手册-虚拟支付篇](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/virtual-payment/guide.html) + /// 发起购买游戏币支付请求,可参考[虚拟支付2.0游戏币](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/virtual-payment/coins.html),虚拟支付全流程可参考[技术手册-虚拟支付篇](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/virtual-payment/guide.html) /// **buyQuantity 限制说明** /// 购买游戏币的时候,buyQuantity 不可任意填写。需满足 buyQuantity * 游戏币单价 = 限定的价格等级。如:游戏币单价为 0.1 元,一次购买最少数量是 10。 /// 有效价格等级如下: @@ -1614,7 +1636,7 @@ namespace WeChatWASM /// /// [wx.requestMidasPaymentGameItem(Object object)](https://developers.weixin.qq.com/minigame/dev/api/midas-payment/wx.requestMidasPaymentGameItem.html) /// 需要基础库: `2.19.2` - /// 发起道具直购支付请求,可参考[虚拟支付2.0道具直购](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/virtual-payment/goods.html ),虚拟支付全流程可参考[技术手册-虚拟支付篇](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/virtual-payment/guide.html) + /// 发起道具直购支付请求,可参考[虚拟支付2.0道具直购](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/virtual-payment/goods.html),虚拟支付全流程可参考[技术手册-虚拟支付篇](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/virtual-payment/guide.html) /// **示例代码** /// ```js /// wx.requestMidasPaymentGameItem({ @@ -2511,6 +2533,18 @@ namespace WeChatWASM WXSDKManagerHandler.Instance.ExitPointerLock(); } + /// + /// [wx.getPhoneNumber(Object object)](https://developers.weixin.qq.com/minigame/dev/api/open-api/user-info/wx.getPhoneNumber.html) + /// 手机号快速验证,向用户申请,并在用户同意后,快速填写和验证手机 [具体说明](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/getPhoneNumber.html) + /// **** + /// ## 注意事项 + /// - 用户点击后才可进行调用 + /// + public static void GetPhoneNumber(GetPhoneNumberOption option) + { + WXSDKManagerHandler.Instance.GetPhoneNumber(option); + } + /// /// [wx.operateGameRecorderVideo(Object object)](https://developers.weixin.qq.com/minigame/dev/api/game-recorder/wx.operateGameRecorderVideo.html) /// 需要基础库: `2.26.1` diff --git a/Runtime/WXRuntimeExtDef.cs b/Runtime/WXRuntimeExtDef.cs index 069c718b..9da8db86 100644 --- a/Runtime/WXRuntimeExtDef.cs +++ b/Runtime/WXRuntimeExtDef.cs @@ -15,7 +15,7 @@ namespace WeChatWASM private static void Init() { - + #if UNITY_2018_1_OR_NEWER WXRuntimeExtEnvDef.SETDEF("UNITY_2018_1_OR_NEWER", true); #else @@ -118,16 +118,16 @@ namespace WeChatWASM */ WXRuntimeExtEnvDef.RegisterAction("Unity.GetObjectInstanceID", (args) => { - #if UNITY_2021_3_OR_NEWER +#if UNITY_2021_3_OR_NEWER if (args is UnityEngine.Object unityObject) { return unityObject.GetInstanceID(); } - #endif +#endif // unityObject.GetInstanceID() would never return 0. - return 0; + return 0; }); } } - + } \ No newline at end of file diff --git a/Runtime/wechat-default/check-version.js.meta b/Runtime/wechat-default/check-version.js.meta index 45663554..e3d14aed 100644 --- a/Runtime/wechat-default/check-version.js.meta +++ b/Runtime/wechat-default/check-version.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e0017b4868bc11344d4b497f061c9a3a +guid: 16a05b355155515fb077e1eeb3f8c64e DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/data-package/game.js.meta b/Runtime/wechat-default/data-package/game.js.meta index cd84a61b..8239c494 100644 --- a/Runtime/wechat-default/data-package/game.js.meta +++ b/Runtime/wechat-default/data-package/game.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b064e7202db1078f95fb857eba01835d +guid: 958394520f22cc142367ba7d4ea1765c DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/events.js.meta b/Runtime/wechat-default/events.js.meta index 01a743ae..5460ccea 100644 --- a/Runtime/wechat-default/events.js.meta +++ b/Runtime/wechat-default/events.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 70223753d51724163250ba491c4ff36e +guid: a6e8166aef44e78570979311b6c2916d DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/game.js.meta b/Runtime/wechat-default/game.js.meta index 85629efe..9322f0c3 100644 --- a/Runtime/wechat-default/game.js.meta +++ b/Runtime/wechat-default/game.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 2074fe799a6eb922ef1c4c70266b646c +guid: 3a5afb518e6dd762ea5f9911ceced27d DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/game.json.meta b/Runtime/wechat-default/game.json.meta index ca5c126b..0cdfa2fe 100644 --- a/Runtime/wechat-default/game.json.meta +++ b/Runtime/wechat-default/game.json.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e978047fa2bce4f28627d1ddf8564bb7 +guid: d8e6c5e1db2448ad70dcbce425be0884 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/images/background.jpg.meta b/Runtime/wechat-default/images/background.jpg.meta index 0c2e7036..0a1775c9 100644 --- a/Runtime/wechat-default/images/background.jpg.meta +++ b/Runtime/wechat-default/images/background.jpg.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3a2cb998f657aad007b1550684521508 +guid: c8d3c70bc92064d94b320759cc24fd9e DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/images/unity_logo.png.meta b/Runtime/wechat-default/images/unity_logo.png.meta index 492193c3..f62f8714 100644 --- a/Runtime/wechat-default/images/unity_logo.png.meta +++ b/Runtime/wechat-default/images/unity_logo.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e8bf68025addc43e1c49627e188bd05c +guid: e704c51338d58f614d7e201f8254248d DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/open-data/data/index.js.meta b/Runtime/wechat-default/open-data/data/index.js.meta index b8b7f7a1..db6d4709 100644 --- a/Runtime/wechat-default/open-data/data/index.js.meta +++ b/Runtime/wechat-default/open-data/data/index.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 23539b6f68febab5a728b034756bd9a9 +guid: dede525edce53074e7bb927313ee5f0d DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/open-data/data/utils.js.meta b/Runtime/wechat-default/open-data/data/utils.js.meta index 3bf18c62..17f982dc 100644 --- a/Runtime/wechat-default/open-data/data/utils.js.meta +++ b/Runtime/wechat-default/open-data/data/utils.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 56d7dd8bab5f82de2a4ec5fc1dbed1bc +guid: 7fc48609205cf071bb1e811bfd315056 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/open-data/index.js.meta b/Runtime/wechat-default/open-data/index.js.meta index 9dce5e73..0160898c 100644 --- a/Runtime/wechat-default/open-data/index.js.meta +++ b/Runtime/wechat-default/open-data/index.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 19e07bb641a2b5a015bdec33af35c588 +guid: ada9c6d2e90182843aa568bd4a37a79e DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/open-data/loading.js.meta b/Runtime/wechat-default/open-data/loading.js.meta index 6fe426f7..0e7d093e 100644 --- a/Runtime/wechat-default/open-data/loading.js.meta +++ b/Runtime/wechat-default/open-data/loading.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: df6d5d80245c41fe8c78988f8d6620e1 +guid: 772d54d7934d68e711e21b406c1c7e12 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/open-data/render/image/avatar.png.meta b/Runtime/wechat-default/open-data/render/image/avatar.png.meta index daddffad..7ebd5c0a 100644 --- a/Runtime/wechat-default/open-data/render/image/avatar.png.meta +++ b/Runtime/wechat-default/open-data/render/image/avatar.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 105ac52497927498bf21ab15aec2268c +guid: d13e4ff353cd7cea63132ff1b88158cb DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/open-data/render/image/button1.png.meta b/Runtime/wechat-default/open-data/render/image/button1.png.meta index dc4713c4..af3ef56d 100644 --- a/Runtime/wechat-default/open-data/render/image/button1.png.meta +++ b/Runtime/wechat-default/open-data/render/image/button1.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a61a415a2468df87721ebf171946b6d9 +guid: 041f0879661b7a23f4c8caf71cbe2d55 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/open-data/render/image/button2.png.meta b/Runtime/wechat-default/open-data/render/image/button2.png.meta index 637b261b..6495e6be 100644 --- a/Runtime/wechat-default/open-data/render/image/button2.png.meta +++ b/Runtime/wechat-default/open-data/render/image/button2.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4c6843305efccfd1ac2dfa165018d577 +guid: 6400804777fac10052d35c723035c029 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/open-data/render/image/button3.png.meta b/Runtime/wechat-default/open-data/render/image/button3.png.meta index 48a88b5c..12b81ceb 100644 --- a/Runtime/wechat-default/open-data/render/image/button3.png.meta +++ b/Runtime/wechat-default/open-data/render/image/button3.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 2d95cb2ac271312c1ac4eb4a160ded69 +guid: aa773743e4bc2a6a0b9742f5ea688b57 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/open-data/render/image/loading.png.meta b/Runtime/wechat-default/open-data/render/image/loading.png.meta index 3d87827d..ec95dcd4 100644 --- a/Runtime/wechat-default/open-data/render/image/loading.png.meta +++ b/Runtime/wechat-default/open-data/render/image/loading.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ca06d15b528803c6c66f21e3faaa30c4 +guid: e011d47283348e5cb965dbd898f91fb5 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/open-data/render/image/nameBg.png.meta b/Runtime/wechat-default/open-data/render/image/nameBg.png.meta index 48dc0ac7..89d5a7ce 100644 --- a/Runtime/wechat-default/open-data/render/image/nameBg.png.meta +++ b/Runtime/wechat-default/open-data/render/image/nameBg.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 555e51161a3db390932008e8586cc0b6 +guid: 613a74b163c5a3f3aa9e677557b9cb7c DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/open-data/render/image/rankAvatar.png.meta b/Runtime/wechat-default/open-data/render/image/rankAvatar.png.meta index f150a3d5..c7c12dfe 100644 --- a/Runtime/wechat-default/open-data/render/image/rankAvatar.png.meta +++ b/Runtime/wechat-default/open-data/render/image/rankAvatar.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 176c40720c4056dd63c45500cf235bc1 +guid: f4d119e13be314b5fd9da6e42a59a94b DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/open-data/render/image/rankBg.png.meta b/Runtime/wechat-default/open-data/render/image/rankBg.png.meta index 3c57fa05..9381ba06 100644 --- a/Runtime/wechat-default/open-data/render/image/rankBg.png.meta +++ b/Runtime/wechat-default/open-data/render/image/rankBg.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 8ee009739cbf2fca11b0e2f8062119a4 +guid: 05e78ed756c856747efeabc5eda3b294 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/open-data/render/image/shareBg.png.meta b/Runtime/wechat-default/open-data/render/image/shareBg.png.meta index 83f22f5b..7e542a9a 100644 --- a/Runtime/wechat-default/open-data/render/image/shareBg.png.meta +++ b/Runtime/wechat-default/open-data/render/image/shareBg.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ab0653e34ab4638c2d3ce71315e36461 +guid: a8a8be052256551196c7a294a39f47bb DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/open-data/render/image/shareBg2.png.meta b/Runtime/wechat-default/open-data/render/image/shareBg2.png.meta index 527eafd5..bc981abf 100644 --- a/Runtime/wechat-default/open-data/render/image/shareBg2.png.meta +++ b/Runtime/wechat-default/open-data/render/image/shareBg2.png.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 431732b1953b902144e6a13c2c3b273d +guid: d9c4539b19f923b681f4d8d127e9f0a8 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/open-data/render/styles/friendRank.js.meta b/Runtime/wechat-default/open-data/render/styles/friendRank.js.meta index 450cd882..5aa10940 100644 --- a/Runtime/wechat-default/open-data/render/styles/friendRank.js.meta +++ b/Runtime/wechat-default/open-data/render/styles/friendRank.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 986e399505721ee6d1a3e9e51cd46a73 +guid: 84185cfca76b52b5c270c7450b2637c3 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/open-data/render/styles/tips.js.meta b/Runtime/wechat-default/open-data/render/styles/tips.js.meta index af0d5acb..42d09b48 100644 --- a/Runtime/wechat-default/open-data/render/styles/tips.js.meta +++ b/Runtime/wechat-default/open-data/render/styles/tips.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: aa48bad9fe71390b61d7285f77df2a99 +guid: 9e630e730159ffeeb38f537b5513a787 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/open-data/render/tpls/friendRank.js.meta b/Runtime/wechat-default/open-data/render/tpls/friendRank.js.meta index 929081c0..717cd5bc 100644 --- a/Runtime/wechat-default/open-data/render/tpls/friendRank.js.meta +++ b/Runtime/wechat-default/open-data/render/tpls/friendRank.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 1d4f64d7aad034123ca6ba242daa8af7 +guid: 4b8bc31c9266a7350471431ad5da26f9 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/open-data/render/tpls/tips.js.meta b/Runtime/wechat-default/open-data/render/tpls/tips.js.meta index cfa71714..270946d0 100644 --- a/Runtime/wechat-default/open-data/render/tpls/tips.js.meta +++ b/Runtime/wechat-default/open-data/render/tpls/tips.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d1c1d21478efee7a00c4965c3aa98c1c +guid: 4cacd7bb620a1052013a7b2c5fc1d7de DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/plugin-config.js.meta b/Runtime/wechat-default/plugin-config.js.meta index e94c3c6e..8ece2705 100644 --- a/Runtime/wechat-default/plugin-config.js.meta +++ b/Runtime/wechat-default/plugin-config.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 865d4adef4da4f68df98768f2c46ad60 +guid: adc8020f92921f525be28ab0b4c1d53f DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/plugins/check-update.js.meta b/Runtime/wechat-default/plugins/check-update.js.meta index 0e9fa130..9fdf7538 100644 --- a/Runtime/wechat-default/plugins/check-update.js.meta +++ b/Runtime/wechat-default/plugins/check-update.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 69dfaf37e39d9f7fca7a3c586dc441fd +guid: 3fd2ee688bc3cb505167a0a92535696e DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/plugins/screen-adapter.js.meta b/Runtime/wechat-default/plugins/screen-adapter.js.meta index 770a754c..76b9b1c5 100644 --- a/Runtime/wechat-default/plugins/screen-adapter.js.meta +++ b/Runtime/wechat-default/plugins/screen-adapter.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 98794c70a482476e5785115b92323662 +guid: 15a936df689f649df5aed242e0fa41cb DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/project.config.json.meta b/Runtime/wechat-default/project.config.json.meta index 2ba4d2be..8868607e 100644 --- a/Runtime/wechat-default/project.config.json.meta +++ b/Runtime/wechat-default/project.config.json.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a5fa1fa1d2efa2699c4cdcca981a3d95 +guid: e7f44227a4631e6dc3302a64e40e05eb DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/texture-config.js.meta b/Runtime/wechat-default/texture-config.js.meta index 903070a0..cfe33a7f 100644 --- a/Runtime/wechat-default/texture-config.js.meta +++ b/Runtime/wechat-default/texture-config.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 40c7e1be1fb5edb66e7710869d2294c8 +guid: 1494b05e202dfb72e4fd72e33832bf8a DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-namespace.js b/Runtime/wechat-default/unity-namespace.js index e3b1002b..92365ce4 100644 --- a/Runtime/wechat-default/unity-namespace.js +++ b/Runtime/wechat-default/unity-namespace.js @@ -1,6 +1,4 @@ // @ts-nocheck -/* eslint-disable no-unused-vars */ -/* eslint-disable no-undef */ const unityNamespace = { canvas: GameGlobal.canvas, // cache width @@ -138,6 +136,7 @@ function bindGloblException() { }); // 上报初始信息 function printSystemInfo(appBaseInfo, deviceInfo) { + // eslint-disable-next-line @typescript-eslint/naming-convention const { version, SDKVersion } = appBaseInfo; const { platform, system } = deviceInfo; unityNamespace.version = version; diff --git a/Runtime/wechat-default/unity-namespace.js.meta b/Runtime/wechat-default/unity-namespace.js.meta index da535701..fb00e165 100644 --- a/Runtime/wechat-default/unity-namespace.js.meta +++ b/Runtime/wechat-default/unity-namespace.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: cba4df47df880263702f15f5eeb93d88 +guid: e8d76d3b347e81c79cd6dd2a08c65c72 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/TCPSocket/index.js.meta b/Runtime/wechat-default/unity-sdk/TCPSocket/index.js.meta index da4a8d3e..323ee637 100644 --- a/Runtime/wechat-default/unity-sdk/TCPSocket/index.js.meta +++ b/Runtime/wechat-default/unity-sdk/TCPSocket/index.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 89d4fa40ec6f9dc1dbb5a2d5ac3bc872 +guid: 20e721eb44bfbc3ef6e56920927b691b DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/UDPSocket/index.js.meta b/Runtime/wechat-default/unity-sdk/UDPSocket/index.js.meta index dcd7917c..c877ec0c 100644 --- a/Runtime/wechat-default/unity-sdk/UDPSocket/index.js.meta +++ b/Runtime/wechat-default/unity-sdk/UDPSocket/index.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b0bf9b308e480e0e90114f6db2c407ae +guid: d8669e848772bf55fc855cd8ae757bdf DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/ad.js.meta b/Runtime/wechat-default/unity-sdk/ad.js.meta index 27854e7e..57c2d524 100644 --- a/Runtime/wechat-default/unity-sdk/ad.js.meta +++ b/Runtime/wechat-default/unity-sdk/ad.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 6cfff2346eeebc89b8fb9ceb3d754f75 +guid: 8c49aeb2c1d527cceba52c19b76d501a DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/audio/common.js.meta b/Runtime/wechat-default/unity-sdk/audio/common.js.meta index 55dd808d..f3e0f37b 100644 --- a/Runtime/wechat-default/unity-sdk/audio/common.js.meta +++ b/Runtime/wechat-default/unity-sdk/audio/common.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 49c05d7b3a9163c90e3c33c619538c5d +guid: f301c56bf721b7a8f37f8d1d66bbd09a DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/audio/const.js.meta b/Runtime/wechat-default/unity-sdk/audio/const.js.meta index 840a639a..5eb8b758 100644 --- a/Runtime/wechat-default/unity-sdk/audio/const.js.meta +++ b/Runtime/wechat-default/unity-sdk/audio/const.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 2b36e37bba1fa4711d59362df20ecbf4 +guid: be172bc214315bfaa25aede4432947a2 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/audio/index.js.meta b/Runtime/wechat-default/unity-sdk/audio/index.js.meta index abe7fb39..4db4700b 100644 --- a/Runtime/wechat-default/unity-sdk/audio/index.js.meta +++ b/Runtime/wechat-default/unity-sdk/audio/index.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b2a00e54a4bee09f3f2bc5fad486b819 +guid: 32384a1994dd74bc1550d8eda2a6940a DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/audio/inner-audio.js.meta b/Runtime/wechat-default/unity-sdk/audio/inner-audio.js.meta index e2df9caa..0847522c 100644 --- a/Runtime/wechat-default/unity-sdk/audio/inner-audio.js.meta +++ b/Runtime/wechat-default/unity-sdk/audio/inner-audio.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 851812825742ff918f3ca2160fc70151 +guid: 1648983286b0034a59fa130aced251c5 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/audio/store.js.meta b/Runtime/wechat-default/unity-sdk/audio/store.js.meta index ef66f549..526f054d 100644 --- a/Runtime/wechat-default/unity-sdk/audio/store.js.meta +++ b/Runtime/wechat-default/unity-sdk/audio/store.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 51bb83075cc3a244108aa0bfde9f4e9c +guid: f1947d7b8150fa371349eca848bcda5b DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/audio/unity-audio.js.meta b/Runtime/wechat-default/unity-sdk/audio/unity-audio.js.meta index 7e8e39ce..89c1463c 100644 --- a/Runtime/wechat-default/unity-sdk/audio/unity-audio.js.meta +++ b/Runtime/wechat-default/unity-sdk/audio/unity-audio.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 8aab140fc2108d854fa651233a16eb5f +guid: 2420b2bd5172fe1a04857dadb5339441 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/audio/utils.js.meta b/Runtime/wechat-default/unity-sdk/audio/utils.js.meta index 45e0c3c4..c04bc2fc 100644 --- a/Runtime/wechat-default/unity-sdk/audio/utils.js.meta +++ b/Runtime/wechat-default/unity-sdk/audio/utils.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: eeac88a41be3b2adeb5c122465b885fc +guid: 0d586eeb420dc9de7040af4562417672 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/authorize.js.meta b/Runtime/wechat-default/unity-sdk/authorize.js.meta index 85e6e4bd..f7c6c823 100644 --- a/Runtime/wechat-default/unity-sdk/authorize.js.meta +++ b/Runtime/wechat-default/unity-sdk/authorize.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 30f878c4e46d7072a1a43c7910e349f8 +guid: 0c5058705ed327eff69a8b3b4886761d DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/bluetooth/index.js.meta b/Runtime/wechat-default/unity-sdk/bluetooth/index.js.meta index 42a63b90..d9da5f6b 100644 --- a/Runtime/wechat-default/unity-sdk/bluetooth/index.js.meta +++ b/Runtime/wechat-default/unity-sdk/bluetooth/index.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b1cb14472f103a06bbf68d8327598773 +guid: 442d76907fd8c3f921e510e5bca34c91 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/camera.js.meta b/Runtime/wechat-default/unity-sdk/camera.js.meta index 9779e288..978bff49 100644 --- a/Runtime/wechat-default/unity-sdk/camera.js.meta +++ b/Runtime/wechat-default/unity-sdk/camera.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 603075c79e5b37f2c2dcbf0855a1eb8e +guid: fdd778fa9f094e23a1139d87e97f0b1f DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/canvas-context.js.meta b/Runtime/wechat-default/unity-sdk/canvas-context.js.meta index f5efbab8..c4cda786 100644 --- a/Runtime/wechat-default/unity-sdk/canvas-context.js.meta +++ b/Runtime/wechat-default/unity-sdk/canvas-context.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e97d9561c1f288bbe7ea6388e028c49a +guid: 2013e86bd2b7226c0c8cd00b9cb7ef87 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/canvas.js.meta b/Runtime/wechat-default/unity-sdk/canvas.js.meta index 58da5b0e..0e8659fa 100644 --- a/Runtime/wechat-default/unity-sdk/canvas.js.meta +++ b/Runtime/wechat-default/unity-sdk/canvas.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 8ad67d8b0c086408340fd5675e2ab4e1 +guid: 0420efb0cc485a8a159bde21d0769070 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/chat.js.meta b/Runtime/wechat-default/unity-sdk/chat.js.meta index 66adcbd3..511381a4 100644 --- a/Runtime/wechat-default/unity-sdk/chat.js.meta +++ b/Runtime/wechat-default/unity-sdk/chat.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f608e2af07c6daafe14261cb48fc53c8 +guid: dfb0474d3b2e51c50e72d38f0411f77d DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/cloud.js.meta b/Runtime/wechat-default/unity-sdk/cloud.js.meta index 0dbe90b7..64ab1e5f 100644 --- a/Runtime/wechat-default/unity-sdk/cloud.js.meta +++ b/Runtime/wechat-default/unity-sdk/cloud.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 1f7952e5e5a367a604291447248f8b0d +guid: 6351e2b2d8e1a98ce573ca6d3f506c27 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/conf.js.meta b/Runtime/wechat-default/unity-sdk/conf.js.meta index 17050e49..f55d4070 100644 --- a/Runtime/wechat-default/unity-sdk/conf.js.meta +++ b/Runtime/wechat-default/unity-sdk/conf.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 2311db7cfab596e0733002f2b3f65a27 +guid: 70a841f0df6a16929a96f5e973a6e843 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/file-info.js.meta b/Runtime/wechat-default/unity-sdk/file-info.js.meta index eed287c6..e5e485b3 100644 --- a/Runtime/wechat-default/unity-sdk/file-info.js.meta +++ b/Runtime/wechat-default/unity-sdk/file-info.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 62c1387891d5d9f5800544aab9647658 +guid: e1d76c9fcefcdada46c2fdaa92c6cf43 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/fix.js.meta b/Runtime/wechat-default/unity-sdk/fix.js.meta index 5c3275f7..54aff296 100644 --- a/Runtime/wechat-default/unity-sdk/fix.js.meta +++ b/Runtime/wechat-default/unity-sdk/fix.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ada0b09542c6f1db5f4432994dbd8a84 +guid: c79fedfe2490ae9b84f64591da22d67b DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/font/fix-cmap.js.meta b/Runtime/wechat-default/unity-sdk/font/fix-cmap.js.meta index c9c7a844..c5bb7461 100644 --- a/Runtime/wechat-default/unity-sdk/font/fix-cmap.js.meta +++ b/Runtime/wechat-default/unity-sdk/font/fix-cmap.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 873117c312ae19b860d6e3ca254bf883 +guid: 08dcaf562e96cb92c357df3a69ff8acb DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/font/index.js b/Runtime/wechat-default/unity-sdk/font/index.js index 800648f7..4e6dd111 100644 --- a/Runtime/wechat-default/unity-sdk/font/index.js +++ b/Runtime/wechat-default/unity-sdk/font/index.js @@ -89,81 +89,94 @@ const fontOptions = { }, CustomUnicodeRange: $CustomUnicodeRange, }; - -function handleGetFontData(config, forceLoad = false) { +function handleGetFontData(config, forceFallback) { + const canGetWxCommonFont = !!GameGlobal.manager?.font?.getCommonFont; + if (!config && !canGetWxCommonFont) { return Promise.reject('invalid usage'); } // eslint-disable-next-line @typescript-eslint/no-misused-promises - if (!getFontPromise || forceLoad) { + if (!getFontPromise || forceFallback) { getFontPromise = new Promise((resolve, reject) => { - if (!canGetWxCommonFont && !!config) { + + if ((!canGetWxCommonFont || forceFallback) && !!config) { const xhr = new GameGlobal.unityNamespace.UnityLoader.UnityCache.XMLHttpRequest(); - xhr.open('GET', config.fallbackUrl, true); - xhr.responseType = 'arraybuffer'; + xhr.open('GET', config.fallbackUrl, true); + xhr.responseType = 'arraybuffer'; xhr.onload = () => { + if ((xhr.status === 200 || xhr.status === 0) && xhr.response) { - const notoFontData = xhr.response; - fontDataCache = notoFontData; - isReadFromCache = xhr.isReadFromCache; - resolve(); + const notoFontData = xhr.response; + fontDataCache = notoFontData; + isReadFromCache = xhr.isReadFromCache; + resolve(); } }; - xhr.onerror = reject; - xhr.send(); + xhr.onerror = reject; + xhr.send(); return; } - let unicodeRange = []; + let unicodeRange = []; Object.keys(fontOptions).forEach((key) => { if (fontOptions[key].include) { - unicodeRange.push(fontOptions[key].unicodeRange); + unicodeRange.push(fontOptions[key].unicodeRange); } }); - unicodeRange = unicodeRange.concat(fontOptions.CustomUnicodeRange); + unicodeRange = unicodeRange.concat(fontOptions.CustomUnicodeRange); + GameGlobal.manager.font.getCommonFont({ success(fontData) { if (isIOS) { fixCmapTable(fontData); } + if (isAndroid) { const tempData = splitTTCToBufferOnlySC(fontData); if (tempData) { - fontData = tempData; + fontData = tempData; } } - fontDataCache = fontData; - resolve(); + fontDataCache = fontData; + resolve(); }, - fail: reject, - }, unicodeRange); + fail: reject, + }, unicodeRange); }); } - return getFontPromise; + return getFontPromise; } -function WXGetFontRawData(conf, callbackId) { - const config = formatJsonStr(conf); - const loadFromRemote = !GameGlobal.manager?.font?.getCommonFont; - GameGlobal.manager.TimeLogger.timeStart('WXGetFontRawData'); - handleGetFontData(config).then(() => { +function WXGetFontRawData(conf, callbackId, forceFallback = false) { + const config = formatJsonStr(conf); + const loadFromRemote = !GameGlobal.manager?.font?.getCommonFont; + GameGlobal.manager.TimeLogger.timeStart('WXGetFontRawData'); + + handleGetFontData(config, forceFallback).then(() => { if (fontDataCache) { - GameGlobal.manager.font.reportGetFontCost(GameGlobal.manager.TimeLogger.timeEnd('WXGetFontRawData'), { loadFromRemote, isReadFromCache, preloadWXFont: GameGlobal.unityNamespace.preloadWXFont }); - const { ascent, descent, lineGap, unitsPerEm } = readMetrics(fontDataCache) || {}; - tempCacheObj[callbackId] = fontDataCache; - moduleHelper.send('GetFontRawDataCallback', JSON.stringify({ callbackId, type: 'success', res: JSON.stringify({ byteLength: fontDataCache.byteLength, ascent, descent, lineGap, unitsPerEm }) })); - GameGlobal.manager.Logger.pluginLog(`[font] load font from ${loadFromRemote ? `network, url=${config.fallbackUrl}` : 'local'}`); - fontDataCache = null; + GameGlobal.manager.font.reportGetFontCost(GameGlobal.manager.TimeLogger.timeEnd('WXGetFontRawData'), { loadFromRemote: forceFallback || loadFromRemote, isReadFromCache, preloadWXFont: GameGlobal.unityNamespace.preloadWXFont }); + const { ascent, descent, lineGap, unitsPerEm } = readMetrics(fontDataCache) || {}; + tempCacheObj[callbackId] = fontDataCache; + moduleHelper.send('GetFontRawDataCallback', JSON.stringify({ callbackId, type: 'success', res: JSON.stringify({ byteLength: fontDataCache.byteLength, ascent, descent, lineGap, unitsPerEm }) })); + GameGlobal.manager.Logger.pluginLog(`[font] load font from ${forceFallback || loadFromRemote ? `network, url=${config.fallbackUrl}` : 'local'}`); + + fontDataCache = null; } else { GameGlobal.manager.Logger.pluginError('[font] load font error: empty content'); } }) .catch((err) => { - GameGlobal.manager.Logger.pluginError('[font] load font error: ', err); + if (err.errmsg === 'no support font' && forceFallback === false) { + + WXGetFontRawData(conf, callbackId, true); + } + else { + GameGlobal.manager.Logger.pluginError('[font] load font error: ', err); + } }); } function WXShareFontBuffer(buffer, offset, callbackId) { diff --git a/Runtime/wechat-default/unity-sdk/font/index.js.meta b/Runtime/wechat-default/unity-sdk/font/index.js.meta index 1b5b93e4..1314c264 100644 --- a/Runtime/wechat-default/unity-sdk/font/index.js.meta +++ b/Runtime/wechat-default/unity-sdk/font/index.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 6994ead4463d67d97280ae0c6ef38d4b +guid: ce900f3f7eaaba1420cbb2fb05c8a348 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/font/read-metrics.js.meta b/Runtime/wechat-default/unity-sdk/font/read-metrics.js.meta index 06adcf9c..2b2bbcad 100644 --- a/Runtime/wechat-default/unity-sdk/font/read-metrics.js.meta +++ b/Runtime/wechat-default/unity-sdk/font/read-metrics.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 0bc3c19d13b01d4467d4308bab7c3267 +guid: 8f41fe80af66c3fadb628f8c1c5f12e2 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/font/split-sc.js.meta b/Runtime/wechat-default/unity-sdk/font/split-sc.js.meta index b60ebc26..b6090cb4 100644 --- a/Runtime/wechat-default/unity-sdk/font/split-sc.js.meta +++ b/Runtime/wechat-default/unity-sdk/font/split-sc.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 6d1baee931d16ee3a0165cff4feb603d +guid: 74d063a7b64821ee2fd31e63f9a6ae9e DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/font/util.js.meta b/Runtime/wechat-default/unity-sdk/font/util.js.meta index dd69a76e..10348cb8 100644 --- a/Runtime/wechat-default/unity-sdk/font/util.js.meta +++ b/Runtime/wechat-default/unity-sdk/font/util.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9b2acc5660c5a79ae58d9d15b9c19481 +guid: f7e89673255d8efc09a1e0aad14fc4cb DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/fs.js.meta b/Runtime/wechat-default/unity-sdk/fs.js.meta index 1860b097..a6fdb1ef 100644 --- a/Runtime/wechat-default/unity-sdk/fs.js.meta +++ b/Runtime/wechat-default/unity-sdk/fs.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 0cbfb3b8ecafb23f48a31057a6ccc548 +guid: 9b1e614ebf7c60b2d7b20778430d1668 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/game-club.js b/Runtime/wechat-default/unity-sdk/game-club.js index e13b54b5..95376fa2 100644 --- a/Runtime/wechat-default/unity-sdk/game-club.js +++ b/Runtime/wechat-default/unity-sdk/game-club.js @@ -25,6 +25,10 @@ export default { config.type = typeEnum[config.type]; // @ts-ignore config.icon = iconEnum[config.icon]; + + if (!config.text) { + config.text = ''; + } const id = uid(); gameClubButtonList[id] = wx.createGameClubButton(config); return id; diff --git a/Runtime/wechat-default/unity-sdk/game-club.js.meta b/Runtime/wechat-default/unity-sdk/game-club.js.meta index 2deb71cd..2589d20f 100644 --- a/Runtime/wechat-default/unity-sdk/game-club.js.meta +++ b/Runtime/wechat-default/unity-sdk/game-club.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: be793dc594ae722e753d0304e9edbcee +guid: fa452434ada2ce2c5c7c48f8238727d1 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/game-recorder.js.meta b/Runtime/wechat-default/unity-sdk/game-recorder.js.meta index f3ad3237..a6a15188 100644 --- a/Runtime/wechat-default/unity-sdk/game-recorder.js.meta +++ b/Runtime/wechat-default/unity-sdk/game-recorder.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c058d2bc9e0752bf04f7e64c1491f1ca +guid: 774c881bf035f9a19685179bd84ca99c DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/gyroscope/index.js.meta b/Runtime/wechat-default/unity-sdk/gyroscope/index.js.meta index 78bfadc0..ef7f0fd5 100644 --- a/Runtime/wechat-default/unity-sdk/gyroscope/index.js.meta +++ b/Runtime/wechat-default/unity-sdk/gyroscope/index.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: fbaa7e91093a30b4626de05167d9a5ea +guid: 4de46be2831ff7233935fe8b38322710 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/index.js.meta b/Runtime/wechat-default/unity-sdk/index.js.meta index fc0a4058..fdbbb318 100644 --- a/Runtime/wechat-default/unity-sdk/index.js.meta +++ b/Runtime/wechat-default/unity-sdk/index.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a02c1a0765fb66cb44bd2f0a70eaae10 +guid: 8a98b5d5f60c8338543b29b611b52a00 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/logger.js.meta b/Runtime/wechat-default/unity-sdk/logger.js.meta index 54e8dbc2..305c1920 100644 --- a/Runtime/wechat-default/unity-sdk/logger.js.meta +++ b/Runtime/wechat-default/unity-sdk/logger.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 7408ac8ed746f3cc8872fe0800df9436 +guid: 3d4ec4e34cd66774d3129cc051c880db DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/mobileKeyboard/index.js b/Runtime/wechat-default/unity-sdk/mobileKeyboard/index.js index 8396583d..55cc9d87 100644 --- a/Runtime/wechat-default/unity-sdk/mobileKeyboard/index.js +++ b/Runtime/wechat-default/unity-sdk/mobileKeyboard/index.js @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/naming-convention */ let FrameworkData = null; const keyboardSetting = { value: '', @@ -13,6 +14,7 @@ const keyboardConfirmlistener = function (res) { keyboardSetting.value = res.value; _JS_MobileKeyboard_Hide(false); }; +// eslint-disable-next-line @typescript-eslint/no-unused-vars const keyboardCompletelistener = function (res) { removeKeyboardListeners(); }; @@ -87,6 +89,7 @@ function _JS_MobileKeyboard_SetText(text) { } keyboardSetting.value = FrameworkData.UTF8ToString(text); } +// eslint-disable-next-line @typescript-eslint/no-unused-vars function _JS_MobileKeyboard_SetTextSelection(start, length) { } @@ -99,7 +102,7 @@ function _JS_MobileKeyboard_Show(text, keyboardType, autocorrection, multiline, mobile_input_hide_delay = null; } if (hasExistingMobileInput) { - if (keyboardSetting.multiple != !!multiline) { + if (keyboardSetting.multiple !== !!multiline) { _JS_MobileKeyboard_Hide(false); return; } diff --git a/Runtime/wechat-default/unity-sdk/mobileKeyboard/index.js.meta b/Runtime/wechat-default/unity-sdk/mobileKeyboard/index.js.meta index 5419b5c3..2fdd84bb 100644 --- a/Runtime/wechat-default/unity-sdk/mobileKeyboard/index.js.meta +++ b/Runtime/wechat-default/unity-sdk/mobileKeyboard/index.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f5a99ecc4dfcaf0577d5e532ea3bff68 +guid: de818e82105273c28e13368f8a48ed3c DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/module-helper.js.meta b/Runtime/wechat-default/unity-sdk/module-helper.js.meta index 7cfe90b5..3f0e2dbe 100644 --- a/Runtime/wechat-default/unity-sdk/module-helper.js.meta +++ b/Runtime/wechat-default/unity-sdk/module-helper.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c592a83a9ddd6c4071c9c6a39c9d64d1 +guid: c45ec24a7311692ac40b152d7c7e036e DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/open-data.js b/Runtime/wechat-default/unity-sdk/open-data.js index c9443ab0..f52c7f45 100644 --- a/Runtime/wechat-default/unity-sdk/open-data.js +++ b/Runtime/wechat-default/unity-sdk/open-data.js @@ -22,7 +22,12 @@ function hookUnityRender() { if (!textureObject) { textureObject = gl.createTexture(); gl.bindTexture(gl.TEXTURE_2D, textureObject); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, getSharedCanvas()); + if (GameGlobal.unityNamespace.unityColorSpace === 'Linear') { + gl.texImage2D(gl.TEXTURE_2D, 0, gl.SRGB8_ALPHA8, gl.RGBA, gl.UNSIGNED_BYTE, getSharedCanvas()); + } + else { + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, getSharedCanvas()); + } gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); @@ -31,7 +36,12 @@ function hookUnityRender() { else { gl.bindTexture(gl.TEXTURE_2D, textureObject); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, getSharedCanvas()); + if (GameGlobal.unityNamespace.unityColorSpace === 'Linear') { + gl.texImage2D(gl.TEXTURE_2D, 0, gl.SRGB8_ALPHA8, gl.RGBA, gl.UNSIGNED_BYTE, getSharedCanvas()); + } + else { + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, getSharedCanvas()); + } } GL.textures[textureId] = textureObject; timerId = requestAnimationFrame(hookUnityRender); diff --git a/Runtime/wechat-default/unity-sdk/open-data.js.meta b/Runtime/wechat-default/unity-sdk/open-data.js.meta index 21bdff3c..29c36645 100644 --- a/Runtime/wechat-default/unity-sdk/open-data.js.meta +++ b/Runtime/wechat-default/unity-sdk/open-data.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4be74980ecd9321d18fec4ca8db96221 +guid: e23799af4861c317c1dd86cc539c07e5 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/recorder.js.meta b/Runtime/wechat-default/unity-sdk/recorder.js.meta index 413f3ec3..02ccb54c 100644 --- a/Runtime/wechat-default/unity-sdk/recorder.js.meta +++ b/Runtime/wechat-default/unity-sdk/recorder.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b94823b4c5922629c9e8924e01ff56f3 +guid: fae6395286ecab820cd396e12765cc2c DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/resType.js b/Runtime/wechat-default/unity-sdk/resType.js index 9235347b..29bf16b5 100644 --- a/Runtime/wechat-default/unity-sdk/resType.js +++ b/Runtime/wechat-default/unity-sdk/resType.js @@ -571,8 +571,13 @@ export const ResType = { hasSystemProxy: 'bool', networkType: 'string', signalStrength: 'number', + weakNet: 'bool', errMsg: 'string', }, + GetPhoneNumberOption: { + isRealtime: 'bool', + phoneNumberNoQuotaToast: 'bool', + }, GetPrivacySettingSuccessCallbackResult: { needAuthorization: 'bool', privacyContractName: 'string', diff --git a/Runtime/wechat-default/unity-sdk/resType.js.meta b/Runtime/wechat-default/unity-sdk/resType.js.meta index e3aab2cd..1773d80c 100644 --- a/Runtime/wechat-default/unity-sdk/resType.js.meta +++ b/Runtime/wechat-default/unity-sdk/resType.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e83f678a04cc0dd1bc699fe182449a02 +guid: fc8de132a7474ddb7aa0514a6fdf2659 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/resTypeOther.js.meta b/Runtime/wechat-default/unity-sdk/resTypeOther.js.meta index a3366940..082f5c02 100644 --- a/Runtime/wechat-default/unity-sdk/resTypeOther.js.meta +++ b/Runtime/wechat-default/unity-sdk/resTypeOther.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 592d611d18e1f41dbe89810066c0cd3c +guid: cdd6d94ae707be27666e2f095f75c7bf DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/response.js.meta b/Runtime/wechat-default/unity-sdk/response.js.meta index 930e2207..f7c98aca 100644 --- a/Runtime/wechat-default/unity-sdk/response.js.meta +++ b/Runtime/wechat-default/unity-sdk/response.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 83dac2fce0f4049a7f6bebee9a6f1766 +guid: 37bfdeacdc00365b11ab61288c71d203 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/sdk.js b/Runtime/wechat-default/unity-sdk/sdk.js index c0de7e82..40798030 100644 --- a/Runtime/wechat-default/unity-sdk/sdk.js +++ b/Runtime/wechat-default/unity-sdk/sdk.js @@ -1481,6 +1481,30 @@ export default { }, }); }, + WX_NavigateBackMiniProgram(conf, callbackId) { + const config = formatJsonStr(conf); + wx.navigateBackMiniProgram({ + ...config, + success(res) { + formatResponse('GeneralCallbackResult', res); + moduleHelper.send('NavigateBackMiniProgramCallback', JSON.stringify({ + callbackId, type: 'success', res: JSON.stringify(res), + })); + }, + fail(res) { + formatResponse('GeneralCallbackResult', res); + moduleHelper.send('NavigateBackMiniProgramCallback', JSON.stringify({ + callbackId, type: 'fail', res: JSON.stringify(res), + })); + }, + complete(res) { + formatResponse('GeneralCallbackResult', res); + moduleHelper.send('NavigateBackMiniProgramCallback', JSON.stringify({ + callbackId, type: 'complete', res: JSON.stringify(res), + })); + }, + }); + }, WX_NavigateToMiniProgram(conf, callbackId) { const config = formatJsonStr(conf); wx.navigateToMiniProgram({ @@ -3311,6 +3335,9 @@ export default { WX_ExitPointerLock() { wx.exitPointerLock(); }, + WX_GetPhoneNumber(option) { + wx.getPhoneNumber(formatJsonStr(option)); + }, WX_OperateGameRecorderVideo(option) { wx.operateGameRecorderVideo(formatJsonStr(option)); }, diff --git a/Runtime/wechat-default/unity-sdk/sdk.js.meta b/Runtime/wechat-default/unity-sdk/sdk.js.meta index 7ceab6fb..85761f5c 100644 --- a/Runtime/wechat-default/unity-sdk/sdk.js.meta +++ b/Runtime/wechat-default/unity-sdk/sdk.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 680c05986a2bedf663223ddb8ddaca3b +guid: da3237105db46d5cc597798aeea703cb DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/share.js.meta b/Runtime/wechat-default/unity-sdk/share.js.meta index cd82ea04..ca431dc5 100644 --- a/Runtime/wechat-default/unity-sdk/share.js.meta +++ b/Runtime/wechat-default/unity-sdk/share.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 7db7bc25a1b66bb1d41aa048de97a0c7 +guid: 4cce29af33dc896c24b57054b8c6c1b5 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/storage.js.meta b/Runtime/wechat-default/unity-sdk/storage.js.meta index f6c35600..400588e8 100644 --- a/Runtime/wechat-default/unity-sdk/storage.js.meta +++ b/Runtime/wechat-default/unity-sdk/storage.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 2480e7796ebaddb09bc7d17ddaff7ca8 +guid: af41299316ef5adcf7d24faa63a44360 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/texture.js.meta b/Runtime/wechat-default/unity-sdk/texture.js.meta index 38defd13..c4ddac2a 100644 --- a/Runtime/wechat-default/unity-sdk/texture.js.meta +++ b/Runtime/wechat-default/unity-sdk/texture.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4ecc4886d84b202c239c09c25c67fa11 +guid: 86ecd93213ab886f907bdb85cf57d0cd DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/touch/index.js.meta b/Runtime/wechat-default/unity-sdk/touch/index.js.meta index 08f22408..0d9773db 100644 --- a/Runtime/wechat-default/unity-sdk/touch/index.js.meta +++ b/Runtime/wechat-default/unity-sdk/touch/index.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 81d519bb8f1310f3e1d8cf8336faad01 +guid: 31e92cd37d8c1e2914ec6b5c0b173c05 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/upload-file.js.meta b/Runtime/wechat-default/unity-sdk/upload-file.js.meta index 424fd350..65addb43 100644 --- a/Runtime/wechat-default/unity-sdk/upload-file.js.meta +++ b/Runtime/wechat-default/unity-sdk/upload-file.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 6edd040647ac31790d78978e5a865b38 +guid: 8b1aa3bae97845da87975f84a209590b DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/userinfo.js.meta b/Runtime/wechat-default/unity-sdk/userinfo.js.meta index 83868251..0f24b018 100644 --- a/Runtime/wechat-default/unity-sdk/userinfo.js.meta +++ b/Runtime/wechat-default/unity-sdk/userinfo.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ea000525136f37cf48a00312b08043c1 +guid: fc41fca60c1ca8bc937b6c6f36e44bec DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/util.js.meta b/Runtime/wechat-default/unity-sdk/util.js.meta index 995f79ff..e7e978ed 100644 --- a/Runtime/wechat-default/unity-sdk/util.js.meta +++ b/Runtime/wechat-default/unity-sdk/util.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 11b8ff56ba9505b4f806132d899d0cb0 +guid: 1f9e35c970f1f2e51b669b7f4793b1d5 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/utils.js.meta b/Runtime/wechat-default/unity-sdk/utils.js.meta index d050c999..8a8d64a5 100644 --- a/Runtime/wechat-default/unity-sdk/utils.js.meta +++ b/Runtime/wechat-default/unity-sdk/utils.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 39424afd4466f7567556e8f3def31ffc +guid: aad8104a9b68c11ec1a82419178d87be DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/video.js.meta b/Runtime/wechat-default/unity-sdk/video.js.meta index 36da7b15..df1d7265 100644 --- a/Runtime/wechat-default/unity-sdk/video.js.meta +++ b/Runtime/wechat-default/unity-sdk/video.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 43e1466fb6ddff0aba532c804f457238 +guid: 0b143cb5163f7ad6603e78282324a0d6 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/video/index.js.meta b/Runtime/wechat-default/unity-sdk/video/index.js.meta index 179c35ea..8a86626b 100644 --- a/Runtime/wechat-default/unity-sdk/video/index.js.meta +++ b/Runtime/wechat-default/unity-sdk/video/index.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 7d758fcde5a805798ca31d6c1fff6119 +guid: bea8b780039eed692dbe3a8bb30f2f1a DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/wasmcode/game.js.meta b/Runtime/wechat-default/wasmcode/game.js.meta index 29ca06a9..51a712c6 100644 --- a/Runtime/wechat-default/wasmcode/game.js.meta +++ b/Runtime/wechat-default/wasmcode/game.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 99eab503c152e075662b7bf7198bf530 +guid: 6451848035bdd059e5d45581a902318e DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/weapp-adapter.js.meta b/Runtime/wechat-default/weapp-adapter.js.meta index 70734a6c..7ff734eb 100644 --- a/Runtime/wechat-default/weapp-adapter.js.meta +++ b/Runtime/wechat-default/weapp-adapter.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9f0fd9cfece8a229858fe7f381193c92 +guid: 398b261d2f766711f6ae5c694a0bb5e0 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/workers/response/index.js.meta b/Runtime/wechat-default/workers/response/index.js.meta index 97a4c01a..0894f63e 100644 --- a/Runtime/wechat-default/workers/response/index.js.meta +++ b/Runtime/wechat-default/workers/response/index.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 83458e563478a6f980e4bb42b4aa3d7b +guid: c72714275ce681f4d662c8908c7981e9 DefaultImporter: externalObjects: {} userData: diff --git a/WebGLTemplates/WXTemplate/index.html b/WebGLTemplates/WXTemplate/index.html index 2d437823..94072bb2 100644 --- a/WebGLTemplates/WXTemplate/index.html +++ b/WebGLTemplates/WXTemplate/index.html @@ -375,7 +375,8 @@ WX_CloudDownloadFile() {}, WX_CloudGetTempFileURL() {}, WX_CloudDeleteFile() {}, - + WX_CloudCDN() {}, + WXLaunchOperaBridge() {}, WX_AddCard(conf, callbackId){}, WX_AuthPrivateMessage(conf, callbackId){}, WX_Authorize(conf, callbackId){}, @@ -435,6 +436,7 @@ WX_JoinVoIPChat(conf, callbackId){}, WX_Login(conf, callbackId){}, WX_MakeBluetoothPair(conf, callbackId){}, + WX_NavigateBackMiniProgram(conf, callbackId){}, WX_NavigateToMiniProgram(conf, callbackId){}, WX_NotifyBLECharacteristicValueChange(conf, callbackId){}, WX_OpenAppAuthorizeSetting(conf, callbackId){}, @@ -513,6 +515,7 @@ WX_OpenBusinessView(conf, callbackId){}, WX_ExitPointerLock() {}, + WX_GetPhoneNumber() {}, WX_OperateGameRecorderVideo() {}, WX_RemoveStorageSync() {}, WX_ReportEvent() {}, diff --git a/WebGLTemplates/WXTemplate2020/index.html b/WebGLTemplates/WXTemplate2020/index.html index 402a7573..0898164e 100644 --- a/WebGLTemplates/WXTemplate2020/index.html +++ b/WebGLTemplates/WXTemplate2020/index.html @@ -447,7 +447,8 @@ WX_CloudDownloadFile() {}, WX_CloudGetTempFileURL() {}, WX_CloudDeleteFile() {}, - + WX_CloudCDN() {}, + WXLaunchOperaBridge() {}, WX_AddCard(conf, callbackId){}, WX_AuthPrivateMessage(conf, callbackId){}, WX_Authorize(conf, callbackId){}, @@ -507,6 +508,7 @@ WX_JoinVoIPChat(conf, callbackId){}, WX_Login(conf, callbackId){}, WX_MakeBluetoothPair(conf, callbackId){}, + WX_NavigateBackMiniProgram(conf, callbackId){}, WX_NavigateToMiniProgram(conf, callbackId){}, WX_NotifyBLECharacteristicValueChange(conf, callbackId){}, WX_OpenAppAuthorizeSetting(conf, callbackId){}, @@ -585,6 +587,7 @@ WX_OpenBusinessView(conf, callbackId){}, WX_ExitPointerLock() {}, + WX_GetPhoneNumber() {}, WX_OperateGameRecorderVideo() {}, WX_RemoveStorageSync() {}, WX_ReportEvent() {}, diff --git a/WebGLTemplates/WXTemplate2022/index.html b/WebGLTemplates/WXTemplate2022/index.html index 9bdb3d71..5a72d381 100755 --- a/WebGLTemplates/WXTemplate2022/index.html +++ b/WebGLTemplates/WXTemplate2022/index.html @@ -524,7 +524,8 @@ WX_CloudDownloadFile() {}, WX_CloudGetTempFileURL() {}, WX_CloudDeleteFile() {}, - + WX_CloudCDN() {}, + WXLaunchOperaBridge() {}, WX_AddCard(conf, callbackId){}, WX_AuthPrivateMessage(conf, callbackId){}, WX_Authorize(conf, callbackId){}, @@ -584,6 +585,7 @@ WX_JoinVoIPChat(conf, callbackId){}, WX_Login(conf, callbackId){}, WX_MakeBluetoothPair(conf, callbackId){}, + WX_NavigateBackMiniProgram(conf, callbackId){}, WX_NavigateToMiniProgram(conf, callbackId){}, WX_NotifyBLECharacteristicValueChange(conf, callbackId){}, WX_OpenAppAuthorizeSetting(conf, callbackId){}, @@ -662,6 +664,7 @@ WX_OpenBusinessView(conf, callbackId){}, WX_ExitPointerLock() {}, + WX_GetPhoneNumber() {}, WX_OperateGameRecorderVideo() {}, WX_RemoveStorageSync() {}, WX_ReportEvent() {},