diff --git a/CHANGELOG.md b/CHANGELOG.md index eda644193..4aa252520 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,41 @@ Removed - 删除功能/接口 Fixed - 修复问题 Others - 其他 --> -## v0.1.26 【预发布】 +## 2025-11-6 v0.1.30 【重要更新】 +### Feature +* 重要:EmscriptenGLX支持微信压缩纹理 +* 普通:EmscriptenGLX支持Android glReadpixels +* 普通:EmscriptenGLX优化Android CPU与功耗 +* 普通:Metal高帧率下功耗优化 +* 普通:团结引擎buildprofile支持 +### Fixed +* 重要:Metal编码库batch size修复 +* 普通:PageManager相关问题修复 +* 普通:iOS18的微信字体修复 + +## 2025-9-8 v0.1.29 【重要更新】 +### Feature +* 普通:本地缓存存在时,UnityWebRequest支持同步方式(API:wx.SetSyncReadCacheEnabled)以加快读取速度 +* 重要:Emscriptenglx相关能力支持,兼容unity2021/2022/tuanjie +* 重要:新版本的Wasm分包能力支持:大幅度优化了iOS平台高性能(+)模式的分包性能表现,大幅度减少了开发者预处理操作耗时,优化了分包操作耗时 +* 普通:适配插件版本升至1.2.80 + +## 2025-8-12 v0.1.28 【重要更新】 +### Feature +* 普通:PageManager.Show支持Promise +* 普通:性能工具实时数据流支持 +* 普通:适配插件版本升至1.2.79 +### Fixed +* 重要:修复Touch时进行IOS音频resume造成的卡顿问题 +* 重要:UnityWebRequest、AssetBundle、Addressables等加载已缓存资源时,读文件报错导致游戏异常 + +## 2025-7-10 v0.1.27 【普通更新】 +### Feature +* 普通:新增 JS_Sound_GetPosition 方法用于获取音频播放位置 +* 普通:WebGL2变更为正式特性 +* 普通:支持小游戏试玩导出 + +## 2025-5-8 v0.1.26 【普通更新】 ### Feature * 普通:增加禁止多点触控的配置 ### Fixed diff --git a/Editor/BuildProfile.meta b/Editor/BuildProfile.meta index 252f755cb..92fa06b64 100644 --- a/Editor/BuildProfile.meta +++ b/Editor/BuildProfile.meta @@ -1,8 +1,8 @@ fileFormatVersion: 2 -guid: DytLvSj8UC9CKob0XUy9Y3usKDmX8US1YgxYmBxa1iAZ/I8JbM5wZwE= +guid: 4ada38394365d4d28a5ce4c336723cce folderAsset: yes DefaultImporter: externalObjects: {} userData: assetBundleName: - assetBundleVariant: + assetBundleVariant: \ No newline at end of file diff --git a/Editor/BuildProfile/WeixinMiniGameSettings.cs b/Editor/BuildProfile/WeixinMiniGameSettings.cs new file mode 100644 index 000000000..9cb64e499 --- /dev/null +++ b/Editor/BuildProfile/WeixinMiniGameSettings.cs @@ -0,0 +1,136 @@ +#if TUANJIE_1_4_OR_NEWER +using System; +using System.IO; +using System.Collections; +using System.Collections.Generic; +using System.Reflection; +using UnityEditor; +using UnityEngine; +using UnityEditor.Build.Profile; + +namespace WeChatWASM +{ + public class WeixinMiniGameSettings : MiniGameSettings + { + public WXProjectConf ProjectConf; + public SDKOptions SDKOptions; + public CompileOptions CompileOptions; + public CompressTexture CompressTexture; + public List PlayerPrefsKeys = new List(); + public FontOptions FontOptions; + + [SerializeField] public bool m_AutomaticFillInstantGame = true; + + public WeixinMiniGameSettings(MiniGameSettingsEditor editor) : base(editor) + { + } + + public bool PreprocessBuild(BuildProfile buildProfile, BuildOptions options) + { + bool result = true; + if (!string.IsNullOrEmpty(buildProfile.buildPath)) + { + this.ProjectConf.DST = buildProfile.buildPath; + } + else + { + Debug.LogError("Build Path is empty!"); + result = false; + } + this.CompileOptions.DevelopBuild = buildProfile.platformSettings.development; + this.CompileOptions.AutoProfile = buildProfile.platformSettings.connectProfiler; + + this.CompileOptions.CleanBuild = ((int)options & (int)BuildOptions.CleanBuildCache) != 0; + this.CompileOptions.ScriptOnly = ((int)options & (int)BuildOptions.BuildScriptsOnly) != 0; + + return result; + } + + internal void FillAutoStreamingAutomatically() + { + // Instant Game + if (WXConvertCore.IsInstantGameAutoStreaming()) + { + if (m_AutomaticFillInstantGame) + { + ProjectConf.CDN = WXConvertCore.GetInstantGameAutoStreamingCDN(); + if (!ProjectConf.bundlePathIdentifier.Contains("CUS/CustomAB;")) + { + ProjectConf.bundlePathIdentifier = "CUS/CustomAB;" + ProjectConf.bundlePathIdentifier; + } + if (!ProjectConf.bundlePathIdentifier.Contains("AS;")) + { + ProjectConf.bundlePathIdentifier = "AS;" + ProjectConf.bundlePathIdentifier; + } + ProjectConf.dataFileSubPrefix = "CUS"; + } + } + } + + public static void AutoStreamingLoad() + { + if (!WXConvertCore.IsInstantGameAutoStreaming()) + { + return; + } + + // Generate + Type asTextureUIType = Type.GetType("Unity.AutoStreaming.ASTextureUI,Unity.InstantGame.Editor"); + if (asTextureUIType == null) + { + Debug.LogError("Type 'Unity.AutoStreaming.ASTextureUI' not found. "); + return; + } + MethodInfo generateTextureAssetBundlesMethod = asTextureUIType.GetMethod("GenerateTextureAssetBundles", BindingFlags.NonPublic | BindingFlags.Static); + generateTextureAssetBundlesMethod?.Invoke(null, new object[] { false }); + + // reflection to get WXConvertCore.FirstBundlePath + String FirstBundlePath = ""; + var type = Type.GetType("WeChatWASM.WXConvertCore,WxEditor"); + if (type == null) + { + Debug.LogError("Type 'WeChatWASM.WXConvertCore,WxEditor' not found. "); + return; + } + FieldInfo fieldInfo = type.GetField("FirstBundlePath", BindingFlags.Public | BindingFlags.Static); + if (fieldInfo != null) + { + FirstBundlePath = fieldInfo.GetValue(null) as String; + } + + if (!string.IsNullOrEmpty(FirstBundlePath) && File.Exists(FirstBundlePath)) + { + Type igBuildPipelineType = Type.GetType("Unity.InstantGame.IGBuildPipeline,Unity.InstantGame.Editor"); + if (igBuildPipelineType == null) + { + Debug.LogError("Type 'Unity.InstantGame.IGBuildPipeline' not found. "); + return; + } + MethodInfo uploadMethod = igBuildPipelineType.GetMethod("UploadWeChatDataFile", BindingFlags.Public | BindingFlags.Static); + + bool returnValue = false; + if (uploadMethod != null) + { + object[] parameters = new object[] { FirstBundlePath }; + object result = uploadMethod.Invoke(null, parameters); + returnValue = Convert.ToBoolean(result); + } + + if (returnValue) + { + Debug.Log("转换完成并成功上传首包资源"); + } + else + { + Debug.LogError("首包资源上传失败,请检查网络以及Auto Streaming配置是否正确。"); + } + } + else + { + Debug.LogError("转换失败"); + } + } + + } +} +#endif diff --git a/Editor/BuildProfile/WeixinMiniGameSettings.cs.meta b/Editor/BuildProfile/WeixinMiniGameSettings.cs.meta new file mode 100644 index 000000000..fb8bfb838 --- /dev/null +++ b/Editor/BuildProfile/WeixinMiniGameSettings.cs.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 35f480205054085db3ceb2be04b7e97a +DefaultImporter: +externalObjects: {} +userData: +assetBundleName: +assetBundleVariant: \ No newline at end of file diff --git a/Editor/BuildProfile/WeixinMiniGameSettingsEditor.cs b/Editor/BuildProfile/WeixinMiniGameSettingsEditor.cs new file mode 100644 index 000000000..74b04a5d0 --- /dev/null +++ b/Editor/BuildProfile/WeixinMiniGameSettingsEditor.cs @@ -0,0 +1,586 @@ +#if TUANJIE_1_4_OR_NEWER +using System; +using System.Collections.Generic; +using System.IO; +using System.Reflection; +using UnityEditor; +using UnityEditor.Build.Profile; +using UnityEngine; +using static WeChatWASM.WXConvertCore; + +namespace WeChatWASM +{ + public class WeixinMiniGameSettingsEditor : MiniGameSettingsEditor + { + private Vector2 scrollRoot; + private bool foldBaseInfo = true; + private bool foldLoadingConfig = true; + private bool foldSDKOptions = true; + private bool foldDebugOptions = true; + + private bool foldInstantGame = false; + + private bool foldFontOptions = false; + private Dictionary formInputData = new Dictionary(); + private Dictionary formIntPopupData = new Dictionary(); + private Dictionary formCheckboxData = new Dictionary(); + public Texture tex; + + public override void OnMiniGameSettingsIMGUI(SerializedObject serializedObject, SerializedProperty miniGameProperty) + { + OnSettingsGUI(serializedObject, miniGameProperty); + } + + public void OnSettingsGUI(SerializedObject serializedObject, SerializedProperty miniGameProperty) + { + loadData(serializedObject, miniGameProperty); + + scrollRoot = EditorGUILayout.BeginScrollView(scrollRoot); + + GUIStyle linkStyle = new GUIStyle(GUI.skin.label); + linkStyle.normal.textColor = Color.yellow; + linkStyle.hover.textColor = Color.yellow; + linkStyle.stretchWidth = false; + linkStyle.alignment = TextAnchor.UpperLeft; + linkStyle.wordWrap = true; + + foldBaseInfo = EditorGUILayout.Foldout(foldBaseInfo, "基本信息"); + if (foldBaseInfo) + { + EditorGUILayout.BeginVertical("frameBox", GUILayout.ExpandWidth(true)); + + formInput("appid", "游戏AppID"); + formInput("cdn", "游戏资源CDN"); + formInput("projectName", "小游戏项目名"); + formIntPopup("orientation", "游戏方向", new[] { "Portrait", "Landscape", "LandscapeLeft", "LandscapeRight" }, new[] { 0, 1, 2, 3 }); + formInput("memorySize", "UnityHeap预留内存(?)", "单位MB,预分配内存值,超休闲游戏256/中轻度496/重度游戏768,需预估游戏最大UnityHeap值以防止内存自动扩容带来的峰值尖刺。预估方法请查看GIT文档《优化Unity WebGL的内存》"); + + EditorGUILayout.EndVertical(); + } + + foldLoadingConfig = EditorGUILayout.Foldout(foldLoadingConfig, "启动Loading配置"); + if (foldLoadingConfig) + { + EditorGUILayout.BeginVertical("frameBox", GUILayout.ExpandWidth(true)); + + GUILayout.BeginHorizontal(); + string targetBg = "bgImageSrc"; + EditorGUILayout.LabelField(string.Empty, GUILayout.Width(10)); + tex = (Texture)EditorGUILayout.ObjectField("启动背景图/视频封面", tex, typeof(Texture2D), false); + var currentBgSrc = AssetDatabase.GetAssetPath(tex); + if (!string.IsNullOrEmpty(currentBgSrc) && currentBgSrc != formInputData[targetBg]) + { + formInputData[targetBg] = currentBgSrc; + saveData(serializedObject, miniGameProperty); + } + GUILayout.EndHorizontal(); + + formInput("videoUrl", "加载阶段视频URL"); + formIntPopup("assetLoadType", "首包资源加载方式", new[] { "CDN", "小游戏包内" }, new[] { 0, 1 }); + formCheckbox("compressDataPackage", "压缩首包资源(?)", "将首包资源Brotli压缩, 降低资源大小. 注意: 首次启动耗时可能会增加200ms, 仅推荐使用小游戏分包加载时节省包体大小使用"); + formInput("bundleExcludeExtensions", "不自动缓存文件类型(?)", "(使用;分割)当请求url包含资源'cdn+StreamingAssets'时会自动缓存,但StreamingAssets目录下不是所有文件都需缓存,此选项配置不需要自动缓存的文件拓展名。默认值json"); + formInput("bundleHashLength", "Bundle名称Hash长度(?)", "自定义Bundle文件名中hash部分长度,默认值32,用于缓存控制。"); + formInput("preloadFiles", "预下载文件列表(?)", "使用;间隔,支持模糊匹配"); + + EditorGUILayout.EndVertical(); + } + + foldSDKOptions = EditorGUILayout.Foldout(foldSDKOptions, "SDK功能选项"); + if (foldSDKOptions) + { + EditorGUILayout.BeginVertical("frameBox", GUILayout.ExpandWidth(true)); + + formCheckbox("useFriendRelation", "使用好友关系链"); + formCheckbox("useMiniGameChat", "使用社交组件"); + formCheckbox("preloadWXFont", "预加载微信字体(?)", "在game.js执行开始时预载微信系统字体,运行期间可使用WX.GetWXFont获取微信字体"); + formCheckbox("disableMultiTouch", "禁止多点触控"); + + EditorGUILayout.EndVertical(); + } + + foldDebugOptions = EditorGUILayout.Foldout(foldDebugOptions, "调试编译选项"); + if (foldDebugOptions) + { + EditorGUILayout.BeginVertical("frameBox", GUILayout.ExpandWidth(true)); + // formCheckbox("developBuild", "Development Build"); + formCheckbox("autoProfile", "Auto connect Profiler"); + formCheckbox("scriptOnly", "Scripts Only Build"); +#if TUANJIE_2022_3_OR_NEWER + // TODO: if overwrite by OverwritePlayerSettings + bool UseIL2CPP = PlayerSettings.GetScriptingBackend(BuildTargetGroup.WeixinMiniGame) == ScriptingImplementation.IL2CPP; +#else + bool UseIL2CPP = true; +#endif + formCheckbox("il2CppOptimizeSize", "Il2Cpp Optimize Size(?)", "对应于Il2CppCodeGeneration选项,勾选时使用OptimizeSize(默认推荐),生成代码小15%左右,取消勾选则使用OptimizeSpeed。游戏中大量泛型集合的高频访问建议OptimizeSpeed,在使用HybridCLR等第三方组件时只能用OptimizeSpeed。(Dotnet Runtime模式下该选项无效)", !UseIL2CPP); + formCheckbox("profilingFuncs", "Profiling Funcs"); + formCheckbox("profilingMemory", "Profiling Memory"); + + formCheckbox("webgl2", "WebGL2.0(beta)"); + formCheckbox("iOSPerformancePlus", "iOSPerformancePlus(?)", "是否使用iOS高性能+渲染方案,有助于提升渲染兼容性、降低WebContent进程内存"); + formCheckbox("EmscriptenGLX", "EmscriptenGLX(?)", "是否使用EmscriptenGLX渲染方案"); + formCheckbox("iOSMetal", "iOSMetal(?)", "是否使用iOSMetal渲染方案,需要开启iOS高性能+模式,有助于提升运行性能,降低iOS功耗"); + formCheckbox("deleteStreamingAssets", "Clear Streaming Assets"); + formCheckbox("cleanBuild", "Clean WebGL Build"); + // formCheckbox("cleanCloudDev", "Clean Cloud Dev"); + formCheckbox("fbslim", "首包资源优化(?)", "导出时自动清理UnityEditor默认打包但游戏项目从未使用的资源,瘦身首包资源体积。(团结引擎已无需开启该能力)", UnityUtil.GetEngineVersion() > 0, (res) => + { + var fbWin = EditorWindow.GetWindow(typeof(WXFbSettingWindow), false, "首包资源优化配置面板", true); + fbWin.minSize = new Vector2(680, 350); + fbWin.Show(); + }); + formCheckbox("autoAdaptScreen", "自适应屏幕尺寸(?)", "移动端旋转屏幕和PC端拉伸窗口时,自动调整画布尺寸"); + formCheckbox("showMonitorSuggestModal", "显示优化建议弹窗"); + formCheckbox("enableProfileStats", "显示性能面板"); + formCheckbox("enableRenderAnalysis", "显示渲染日志(dev only)"); + + { + formCheckbox("brotliMT", "brotli多线程压缩(?)", "开启多线程压缩可以提高出包速度,但会降低压缩率。如若不使用wasm代码分包请勿用多线程出包上线"); + } + EditorGUILayout.EndVertical(); + } + + if (WXConvertCore.IsInstantGameAutoStreaming()) + { + foldInstantGame = EditorGUILayout.Foldout(foldInstantGame, "Instant Game - AutoStreaming"); + if (foldInstantGame) + { + var automaticfillinstantgame = miniGameProperty.FindPropertyRelative("m_AutomaticFillInstantGame"); + EditorGUILayout.BeginVertical("frameBox", GUILayout.ExpandWidth(true)); + GUILayout.BeginHorizontal(); + EditorGUILayout.LabelField(string.Empty, GUILayout.Width(10)); + formCheckbox("m_AutomaticFillInstantGame", "自动填写AutoStreaming", "仅在开启AutoStreaming生效"); + GUILayout.EndHorizontal(); + formInput("bundlePathIdentifier", "Bundle Path Identifier"); + formInput("dataFileSubPrefix", "Data File Sub Prefix"); + + EditorGUI.BeginDisabledGroup(true); + formCheckbox("autoUploadFirstBundle", "构建后自动上传首包(?)", "仅在开启AutoStreaming生效", true); + EditorGUI.EndDisabledGroup(); + + GUILayout.BeginHorizontal(); + EditorGUILayout.LabelField(string.Empty, GUILayout.Width(10)); + GUILayout.Label(new GUIContent("清理AS配置(?)", "如需关闭AutoStreaming选用默认发布方案则需要清理AS配置项目。"), GUILayout.Width(140)); + EditorGUI.BeginDisabledGroup(WXConvertCore.IsInstantGameAutoStreaming()); + if (GUILayout.Button(new GUIContent("恢复"), GUILayout.Width(60))) + { + var ProjectConf = miniGameProperty.FindPropertyRelative("ProjectConf"); + string identifier = ProjectConf.FindPropertyRelative("bundlePathIdentifier").stringValue; + string[] identifiers = identifier.Split(";"); + string idStr = ""; + foreach (string id in identifiers) + { + if (id != "AS" && id != "CUS/CustomAB") + { + idStr += id + ";"; + } + } + ProjectConf.FindPropertyRelative("bundlePathIdentifier").stringValue = idStr.Trim(';'); + + if (ProjectConf.FindPropertyRelative("dataFileSubPrefix").stringValue == "CUS") + { + ProjectConf.FindPropertyRelative("dataFileSubPrefix").stringValue = ""; + } + loadData(serializedObject, miniGameProperty); + } + EditorGUI.EndDisabledGroup(); + GUILayout.EndHorizontal(); + + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField(string.Empty); + if (GUILayout.Button(new GUIContent("了解Instant Game AutoStreaming", ""), linkStyle)) + { + Application.OpenURL("https://github.com/wechat-miniprogram/minigame-unity-webgl-transform/blob/main/Design/InstantGameGuide.md"); + } + EditorGUILayout.EndHorizontal(); + EditorGUILayout.EndVertical(); + } + } + + { + foldFontOptions = EditorGUILayout.Foldout(foldFontOptions, "字体配置"); + if (foldFontOptions) + { + EditorGUILayout.BeginVertical("frameBox", GUILayout.ExpandWidth(true)); + formCheckbox("CJK_Unified_Ideographs", "基本汉字(?)", "Unicode [0x4e00, 0x9fff]"); + formCheckbox("C0_Controls_and_Basic_Latin", "基本拉丁语(英文大小写、数字、英文标点)(?)", "Unicode [0x0, 0x7f]"); + formCheckbox("CJK_Symbols_and_Punctuation", "中文标点符号(?)", "Unicode [0x3000, 0x303f]"); + formCheckbox("General_Punctuation", "通用标点符号(?)", "Unicode [0x2000, 0x206f]"); + formCheckbox("Enclosed_CJK_Letters_and_Months", "CJK字母及月份(?)", "Unicode [0x3200, 0x32ff]"); + formCheckbox("Vertical_Forms", "中文竖排标点(?)", "Unicode [0xfe10, 0xfe1f]"); + formCheckbox("CJK_Compatibility_Forms", "CJK兼容符号(?)", "Unicode [0xfe30, 0xfe4f]"); + formCheckbox("Miscellaneous_Symbols", "杂项符号(?)", "Unicode [0x2600, 0x26ff]"); + formCheckbox("CJK_Compatibility", "CJK特殊符号(?)", "Unicode [0x3300, 0x33ff]"); + formCheckbox("Halfwidth_and_Fullwidth_Forms", "全角ASCII、全角中英文标点、半宽片假名、半宽平假名、半宽韩文字母(?)", "Unicode [0xff00, 0xffef]"); + formCheckbox("Dingbats", "装饰符号(?)", "Unicode [0x2700, 0x27bf]"); + formCheckbox("Letterlike_Symbols", "字母式符号(?)", "Unicode [0x2100, 0x214f]"); + formCheckbox("Enclosed_Alphanumerics", "带圈或括号的字母数字(?)", "Unicode [0x2460, 0x24ff]"); + formCheckbox("Number_Forms", "数字形式(?)", "Unicode [0x2150, 0x218f]"); + formCheckbox("Currency_Symbols", "货币符号(?)", "Unicode [0x20a0, 0x20cf]"); + formCheckbox("Arrows", "箭头(?)", "Unicode [0x2190, 0x21ff]"); + formCheckbox("Geometric_Shapes", "几何图形(?)", "Unicode [0x25a0, 0x25ff]"); + formCheckbox("Mathematical_Operators", "数学运算符号(?)", "Unicode [0x2200, 0x22ff]"); + formInput("CustomUnicode", "自定义Unicode(?)", "将填入的所有字符强制加入字体预加载列表"); + EditorGUILayout.EndVertical(); + } + } + + EditorGUILayout.EndScrollView(); + saveData(serializedObject, miniGameProperty); + } + + private void loadData(SerializedObject serializedObject, SerializedProperty miniGameProperty) + { + serializedObject.UpdateIfRequiredOrScript(); + var ProjectConf = miniGameProperty.FindPropertyRelative("ProjectConf"); + + // Instant Game + if (WXConvertCore.IsInstantGameAutoStreaming()) + { + var automaticfillinstantgame = miniGameProperty.FindPropertyRelative("m_AutomaticFillInstantGame"); + if (automaticfillinstantgame.boolValue) + { + ProjectConf.FindPropertyRelative("CDN").stringValue = WXConvertCore.GetInstantGameAutoStreamingCDN(); + if (!ProjectConf.FindPropertyRelative("bundlePathIdentifier").stringValue.Contains("AS;")) + { + ProjectConf.FindPropertyRelative("bundlePathIdentifier").stringValue += "AS;"; + } + if (!ProjectConf.FindPropertyRelative("bundlePathIdentifier").stringValue.Contains("CUS/CustomAB;")) + { + ProjectConf.FindPropertyRelative("bundlePathIdentifier").stringValue += "CUS/CustomAB;"; + } + ProjectConf.FindPropertyRelative("dataFileSubPrefix").stringValue = "CUS"; + } + } + + setData("projectName", ProjectConf.FindPropertyRelative("projectName").stringValue); + setData("appid", ProjectConf.FindPropertyRelative("Appid").stringValue); + setData("cdn", ProjectConf.FindPropertyRelative("CDN").stringValue); + setData("assetLoadType", ProjectConf.FindPropertyRelative("assetLoadType").intValue); + setData("compressDataPackage", ProjectConf.FindPropertyRelative("compressDataPackage").boolValue); + setData("videoUrl", ProjectConf.FindPropertyRelative("VideoUrl").stringValue); + setData("orientation", (int)ProjectConf.FindPropertyRelative("Orientation").enumValueIndex); + //setData("dst", ProjectConf.FindPropertyRelative("relativeDST").stringValue); + setData("bundleHashLength", ProjectConf.FindPropertyRelative("bundleHashLength").intValue.ToString()); + setData("bundlePathIdentifier", ProjectConf.FindPropertyRelative("bundlePathIdentifier").stringValue); + setData("bundleExcludeExtensions", ProjectConf.FindPropertyRelative("bundleExcludeExtensions").stringValue); + setData("preloadFiles", ProjectConf.FindPropertyRelative("preloadFiles").stringValue); + + var CompileOptions = miniGameProperty.FindPropertyRelative("CompileOptions"); + // setData("developBuild", CompileOptions.FindPropertyRelative("DevelopBuild").boolValue); + setData("autoProfile", CompileOptions.FindPropertyRelative("AutoProfile").boolValue); + setData("scriptOnly", CompileOptions.FindPropertyRelative("ScriptOnly").boolValue); + setData("il2CppOptimizeSize", CompileOptions.FindPropertyRelative("Il2CppOptimizeSize").boolValue); + setData("profilingFuncs", CompileOptions.FindPropertyRelative("profilingFuncs").boolValue); + setData("profilingMemory", CompileOptions.FindPropertyRelative("ProfilingMemory").boolValue); + setData("deleteStreamingAssets", CompileOptions.FindPropertyRelative("DeleteStreamingAssets").boolValue); + setData("cleanBuild", CompileOptions.FindPropertyRelative("CleanBuild").boolValue); + setData("customNodePath", CompileOptions.FindPropertyRelative("CustomNodePath").stringValue); + setData("webgl2", CompileOptions.FindPropertyRelative("Webgl2").boolValue); + setData("iOSPerformancePlus", CompileOptions.FindPropertyRelative("enableIOSPerformancePlus").boolValue); + setData("iOSMetal", CompileOptions.FindPropertyRelative("enableiOSMetal").boolValue); + setData("EmscriptenGLX", CompileOptions.FindPropertyRelative("enableEmscriptenGLX").boolValue); + setData("fbslim", CompileOptions.FindPropertyRelative("fbslim").boolValue); + + var SDKOptions = miniGameProperty.FindPropertyRelative("SDKOptions"); + setData("useFriendRelation", SDKOptions.FindPropertyRelative("UseFriendRelation").boolValue); + setData("useMiniGameChat", SDKOptions.FindPropertyRelative("UseMiniGameChat").boolValue); + setData("preloadWXFont", SDKOptions.FindPropertyRelative("PreloadWXFont").boolValue); + setData("disableMultiTouch", SDKOptions.FindPropertyRelative("disableMultiTouch").boolValue); + setData("bgImageSrc", ProjectConf.FindPropertyRelative("bgImageSrc").stringValue); + tex = AssetDatabase.LoadAssetAtPath(ProjectConf.FindPropertyRelative("bgImageSrc").stringValue); + setData("memorySize", ProjectConf.FindPropertyRelative("MemorySize").intValue.ToString()); + setData("hideAfterCallMain", ProjectConf.FindPropertyRelative("HideAfterCallMain").boolValue); + + setData("dataFileSubPrefix", ProjectConf.FindPropertyRelative("dataFileSubPrefix").stringValue); + setData("maxStorage", ProjectConf.FindPropertyRelative("maxStorage").intValue.ToString()); + setData("defaultReleaseSize", ProjectConf.FindPropertyRelative("defaultReleaseSize").intValue.ToString()); + setData("texturesHashLength", ProjectConf.FindPropertyRelative("texturesHashLength").intValue.ToString()); + setData("texturesPath", ProjectConf.FindPropertyRelative("texturesPath").stringValue); + setData("needCacheTextures", ProjectConf.FindPropertyRelative("needCacheTextures").boolValue); + setData("loadingBarWidth", ProjectConf.FindPropertyRelative("loadingBarWidth").intValue.ToString()); + setData("needCheckUpdate", ProjectConf.FindPropertyRelative("needCheckUpdate").boolValue); + setData("disableHighPerformanceFallback", ProjectConf.FindPropertyRelative("disableHighPerformanceFallback").boolValue); + setData("autoAdaptScreen", CompileOptions.FindPropertyRelative("autoAdaptScreen").boolValue); + setData("showMonitorSuggestModal", CompileOptions.FindPropertyRelative("showMonitorSuggestModal").boolValue); + setData("enableProfileStats", CompileOptions.FindPropertyRelative("enableProfileStats").boolValue); + setData("enableRenderAnalysis", CompileOptions.FindPropertyRelative("enableRenderAnalysis").boolValue); + setData("brotliMT", CompileOptions.FindPropertyRelative("brotliMT").boolValue); + setData("autoUploadFirstBundle", true); + setData("m_AutomaticFillInstantGame", miniGameProperty.FindPropertyRelative("m_AutomaticFillInstantGame").boolValue); + + // font options + var FontOptions = miniGameProperty.FindPropertyRelative("FontOptions"); + setData("CJK_Unified_Ideographs", FontOptions.FindPropertyRelative("CJK_Unified_Ideographs").boolValue); + setData("C0_Controls_and_Basic_Latin", FontOptions.FindPropertyRelative("C0_Controls_and_Basic_Latin").boolValue); + setData("CJK_Symbols_and_Punctuation", FontOptions.FindPropertyRelative("CJK_Symbols_and_Punctuation").boolValue); + setData("General_Punctuation", FontOptions.FindPropertyRelative("General_Punctuation").boolValue); + setData("Enclosed_CJK_Letters_and_Months", FontOptions.FindPropertyRelative("Enclosed_CJK_Letters_and_Months").boolValue); + setData("Vertical_Forms", FontOptions.FindPropertyRelative("Vertical_Forms").boolValue); + setData("CJK_Compatibility_Forms", FontOptions.FindPropertyRelative("CJK_Compatibility_Forms").boolValue); + setData("Miscellaneous_Symbols", FontOptions.FindPropertyRelative("Miscellaneous_Symbols").boolValue); + setData("CJK_Compatibility", FontOptions.FindPropertyRelative("CJK_Compatibility").boolValue); + setData("Halfwidth_and_Fullwidth_Forms", FontOptions.FindPropertyRelative("Halfwidth_and_Fullwidth_Forms").boolValue); + setData("Dingbats", FontOptions.FindPropertyRelative("Dingbats").boolValue); + setData("Letterlike_Symbols", FontOptions.FindPropertyRelative("Letterlike_Symbols").boolValue); + setData("Enclosed_Alphanumerics", FontOptions.FindPropertyRelative("Enclosed_Alphanumerics").boolValue); + setData("Number_Forms", FontOptions.FindPropertyRelative("Number_Forms").boolValue); + setData("Currency_Symbols", FontOptions.FindPropertyRelative("Currency_Symbols").boolValue); + setData("Arrows", FontOptions.FindPropertyRelative("Arrows").boolValue); + setData("Geometric_Shapes", FontOptions.FindPropertyRelative("Geometric_Shapes").boolValue); + setData("Mathematical_Operators", FontOptions.FindPropertyRelative("Mathematical_Operators").boolValue); + setData("CustomUnicode", FontOptions.FindPropertyRelative("CustomUnicode").stringValue); + } + + private void saveData(SerializedObject serializedObject, SerializedProperty miniGameProperty) + { + serializedObject.UpdateIfRequiredOrScript(); + + var ProjectConf = miniGameProperty.FindPropertyRelative("ProjectConf"); + ProjectConf.FindPropertyRelative("projectName").stringValue = getDataInput("projectName"); + ProjectConf.FindPropertyRelative("Appid").stringValue = getDataInput("appid"); + ProjectConf.FindPropertyRelative("CDN").stringValue = getDataInput("cdn"); + ProjectConf.FindPropertyRelative("assetLoadType").intValue = getDataPop("assetLoadType"); + ProjectConf.FindPropertyRelative("compressDataPackage").boolValue = getDataCheckbox("compressDataPackage"); + ProjectConf.FindPropertyRelative("VideoUrl").stringValue = getDataInput("videoUrl"); + ProjectConf.FindPropertyRelative("Orientation").enumValueIndex = getDataPop("orientation"); + ProjectConf.FindPropertyRelative("relativeDST").stringValue = serializedObject.FindProperty("m_BuildPath").stringValue; + ProjectConf.FindPropertyRelative("DST").stringValue = GetAbsolutePath(config.ProjectConf.relativeDST); + + ProjectConf.FindPropertyRelative("bundleHashLength").intValue = int.Parse(getDataInput("bundleHashLength")); + ProjectConf.FindPropertyRelative("bundlePathIdentifier").stringValue = getDataInput("bundlePathIdentifier"); + ProjectConf.FindPropertyRelative("bundleExcludeExtensions").stringValue = getDataInput("bundleExcludeExtensions"); + ProjectConf.FindPropertyRelative("preloadFiles").stringValue = getDataInput("preloadFiles"); + + var CompileOptions = miniGameProperty.FindPropertyRelative("CompileOptions"); + + CompileOptions.FindPropertyRelative("DevelopBuild").boolValue = serializedObject.FindProperty("m_PlatformSettings").FindPropertyRelative("m_Development").boolValue; + CompileOptions.FindPropertyRelative("AutoProfile").boolValue = getDataCheckbox("autoProfile"); + CompileOptions.FindPropertyRelative("ScriptOnly").boolValue = getDataCheckbox("scriptOnly"); + CompileOptions.FindPropertyRelative("Il2CppOptimizeSize").boolValue = getDataCheckbox("il2CppOptimizeSize"); + CompileOptions.FindPropertyRelative("profilingFuncs").boolValue = getDataCheckbox("profilingFuncs"); + CompileOptions.FindPropertyRelative("ProfilingMemory").boolValue = getDataCheckbox("profilingMemory"); + CompileOptions.FindPropertyRelative("DeleteStreamingAssets").boolValue = getDataCheckbox("deleteStreamingAssets"); + CompileOptions.FindPropertyRelative("CleanBuild").boolValue = getDataCheckbox("cleanBuild"); + CompileOptions.FindPropertyRelative("CustomNodePath").stringValue = getDataInput("customNodePath"); + CompileOptions.FindPropertyRelative("Webgl2").boolValue = getDataCheckbox("webgl2"); + CompileOptions.FindPropertyRelative("enableIOSPerformancePlus").boolValue = getDataCheckbox("iOSPerformancePlus"); + CompileOptions.FindPropertyRelative("enableiOSMetal").boolValue = getDataCheckbox("iOSMetal"); + CompileOptions.FindPropertyRelative("enableEmscriptenGLX").boolValue = getDataCheckbox("EmscriptenGLX"); + CompileOptions.FindPropertyRelative("fbslim").boolValue = getDataCheckbox("fbslim"); + + var SDKOptions = miniGameProperty.FindPropertyRelative("SDKOptions"); + SDKOptions.FindPropertyRelative("UseFriendRelation").boolValue = getDataCheckbox("useFriendRelation"); + SDKOptions.FindPropertyRelative("UseMiniGameChat").boolValue = getDataCheckbox("useMiniGameChat"); + SDKOptions.FindPropertyRelative("PreloadWXFont").boolValue = getDataCheckbox("preloadWXFont"); + SDKOptions.FindPropertyRelative("disableMultiTouch").boolValue = getDataCheckbox("disableMultiTouch"); + ProjectConf.FindPropertyRelative("bgImageSrc").stringValue = getDataInput("bgImageSrc"); + ProjectConf.FindPropertyRelative("MemorySize").intValue = int.Parse(getDataInput("memorySize")); + ProjectConf.FindPropertyRelative("HideAfterCallMain").boolValue = getDataCheckbox("hideAfterCallMain"); + ProjectConf.FindPropertyRelative("dataFileSubPrefix").stringValue = getDataInput("dataFileSubPrefix"); + ProjectConf.FindPropertyRelative("maxStorage").intValue = int.Parse(getDataInput("maxStorage")); + ProjectConf.FindPropertyRelative("defaultReleaseSize").intValue = int.Parse(getDataInput("defaultReleaseSize")); + ProjectConf.FindPropertyRelative("texturesHashLength").intValue = int.Parse(getDataInput("texturesHashLength")); + ProjectConf.FindPropertyRelative("texturesPath").stringValue = getDataInput("texturesPath"); + ProjectConf.FindPropertyRelative("needCacheTextures").boolValue = getDataCheckbox("needCacheTextures"); + ProjectConf.FindPropertyRelative("loadingBarWidth").intValue = int.Parse(getDataInput("loadingBarWidth")); + ProjectConf.FindPropertyRelative("needCheckUpdate").boolValue = getDataCheckbox("needCheckUpdate"); + ProjectConf.FindPropertyRelative("disableHighPerformanceFallback").boolValue = getDataCheckbox("disableHighPerformanceFallback"); + CompileOptions.FindPropertyRelative("autoAdaptScreen").boolValue = getDataCheckbox("autoAdaptScreen"); + CompileOptions.FindPropertyRelative("showMonitorSuggestModal").boolValue = getDataCheckbox("showMonitorSuggestModal"); + CompileOptions.FindPropertyRelative("enableProfileStats").boolValue = getDataCheckbox("enableProfileStats"); + CompileOptions.FindPropertyRelative("enableRenderAnalysis").boolValue = getDataCheckbox("enableRenderAnalysis"); + CompileOptions.FindPropertyRelative("brotliMT").boolValue = getDataCheckbox("brotliMT"); + + // font options + var FontOptions = miniGameProperty.FindPropertyRelative("FontOptions"); + FontOptions.FindPropertyRelative("CJK_Unified_Ideographs").boolValue = getDataCheckbox("CJK_Unified_Ideographs"); + FontOptions.FindPropertyRelative("C0_Controls_and_Basic_Latin").boolValue = getDataCheckbox("C0_Controls_and_Basic_Latin"); + FontOptions.FindPropertyRelative("CJK_Symbols_and_Punctuation").boolValue = getDataCheckbox("CJK_Symbols_and_Punctuation"); + FontOptions.FindPropertyRelative("General_Punctuation").boolValue = getDataCheckbox("General_Punctuation"); + FontOptions.FindPropertyRelative("Enclosed_CJK_Letters_and_Months").boolValue = getDataCheckbox("Enclosed_CJK_Letters_and_Months"); + FontOptions.FindPropertyRelative("Vertical_Forms").boolValue = getDataCheckbox("Vertical_Forms"); + FontOptions.FindPropertyRelative("CJK_Compatibility_Forms").boolValue = getDataCheckbox("CJK_Compatibility_Forms"); + FontOptions.FindPropertyRelative("Miscellaneous_Symbols").boolValue = getDataCheckbox("Miscellaneous_Symbols"); + FontOptions.FindPropertyRelative("CJK_Compatibility").boolValue = getDataCheckbox("CJK_Compatibility"); + FontOptions.FindPropertyRelative("Halfwidth_and_Fullwidth_Forms").boolValue = getDataCheckbox("Halfwidth_and_Fullwidth_Forms"); + FontOptions.FindPropertyRelative("Dingbats").boolValue = getDataCheckbox("Dingbats"); + FontOptions.FindPropertyRelative("Letterlike_Symbols").boolValue = getDataCheckbox("Letterlike_Symbols"); + FontOptions.FindPropertyRelative("Enclosed_Alphanumerics").boolValue = getDataCheckbox("Enclosed_Alphanumerics"); + FontOptions.FindPropertyRelative("Number_Forms").boolValue = getDataCheckbox("Number_Forms"); + FontOptions.FindPropertyRelative("Currency_Symbols").boolValue = getDataCheckbox("Currency_Symbols"); + FontOptions.FindPropertyRelative("Arrows").boolValue = getDataCheckbox("Arrows"); + FontOptions.FindPropertyRelative("Geometric_Shapes").boolValue = getDataCheckbox("Geometric_Shapes"); + FontOptions.FindPropertyRelative("Mathematical_Operators").boolValue = getDataCheckbox("Mathematical_Operators"); + FontOptions.FindPropertyRelative("CustomUnicode").stringValue = getDataInput("CustomUnicode"); + FontOptions.FindPropertyRelative("Arrows").boolValue = getDataCheckbox("Arrows"); + FontOptions.FindPropertyRelative("Geometric_Shapes").boolValue = getDataCheckbox("Geometric_Shapes"); + FontOptions.FindPropertyRelative("Mathematical_Operators").boolValue = getDataCheckbox("Mathematical_Operators"); + FontOptions.FindPropertyRelative("CustomUnicode").stringValue = getDataInput("CustomUnicode"); + + miniGameProperty.FindPropertyRelative("m_AutomaticFillInstantGame").boolValue = getDataCheckbox("m_AutomaticFillInstantGame"); + + serializedObject.ApplyModifiedProperties(); + } + + private bool getDataCheckbox(string target) + { + if (formCheckboxData.ContainsKey(target)) + return formCheckboxData[target]; + return false; + } + + private string getDataInput(string target) + { + if (formInputData.ContainsKey(target)) + return formInputData[target]; + return ""; + } + + private int getDataPop(string target) + { + if (formIntPopupData.ContainsKey(target)) + return formIntPopupData[target]; + return 0; + } + + private void setData(string target, string value) + { + if (formInputData.ContainsKey(target)) + { + formInputData[target] = value; + } + else + { + formInputData.Add(target, value); + } + } + + private void setData(string target, bool value) + { + if (formCheckboxData.ContainsKey(target)) + { + formCheckboxData[target] = value; + } + else + { + formCheckboxData.Add(target, value); + } + } + + private void setData(string target, int value) + { + if (formIntPopupData.ContainsKey(target)) + { + formIntPopupData[target] = value; + } + else + { + formIntPopupData.Add(target, value); + } + } + + private void formInput(string target, string label, string help = null) + { + if (!formInputData.ContainsKey(target)) + { + formInputData[target] = ""; + } + GUILayout.BeginHorizontal(); + EditorGUILayout.LabelField(string.Empty, GUILayout.Width(10)); + if (help == null) + { + GUILayout.Label(label, GUILayout.Width(140)); + } + else + { + GUILayout.Label(new GUIContent(label, help), GUILayout.Width(140)); + } + formInputData[target] = GUILayout.TextField(formInputData[target], GUILayout.MaxWidth(EditorGUIUtility.currentViewWidth - 195)); + GUILayout.EndHorizontal(); + } + + private void formCheckbox(string target, string label, string help = null, bool disable = false, Action setting = null) + { + if (!formCheckboxData.ContainsKey(target)) + { + formCheckboxData[target] = false; + } + GUILayout.BeginHorizontal(); + EditorGUILayout.LabelField(string.Empty, GUILayout.Width(10)); + if (help == null) + { + GUILayout.Label(label, GUILayout.Width(140)); + } + else + { + GUILayout.Label(new GUIContent(label, help), GUILayout.Width(140)); + } + EditorGUI.BeginDisabledGroup(disable); + formCheckboxData[target] = EditorGUILayout.Toggle(disable ? false : formCheckboxData[target]); + + if (setting != null) + { + EditorGUILayout.LabelField("", GUILayout.Width(10)); + // ���ð�ť + if (GUILayout.Button(new GUIContent("����"), GUILayout.Width(40), GUILayout.Height(18))) + { + setting?.Invoke(true); + } + EditorGUILayout.LabelField("", GUILayout.MinWidth(10)); + } + + EditorGUI.EndDisabledGroup(); + + if (setting == null) + EditorGUILayout.LabelField(string.Empty); + GUILayout.EndHorizontal(); + } + + private void formIntPopup(string target, string label, string[] options, int[] values) + { + if (!formIntPopupData.ContainsKey(target)) + { + formIntPopupData[target] = 0; + } + GUILayout.BeginHorizontal(); + EditorGUILayout.LabelField(string.Empty, GUILayout.Width(10)); + GUILayout.Label(label, GUILayout.Width(140)); + formIntPopupData[target] = EditorGUILayout.IntPopup(formIntPopupData[target], options, values, GUILayout.MaxWidth(EditorGUIUtility.currentViewWidth - 195)); + GUILayout.EndHorizontal(); + } + + public static bool IsAbsolutePath(string path) + { + // 检查是否为空或空白 + if (string.IsNullOrWhiteSpace(path)) + { + return false; + } + + // 在 Windows 上,检查驱动器字母或网络路径 + if (Application.platform == RuntimePlatform.WindowsEditor && Path.IsPathRooted(path)) + { + return true; + } + + // 在 Unix/Linux 和 macOS 上,检查是否以 '/' 开头 + if (Application.platform == RuntimePlatform.OSXEditor && path.StartsWith("/")) + { + return true; + } + + return false; // 否则为相对路径 + } + + public static string GetAbsolutePath(string path) + { + if (IsAbsolutePath(path)) + { + return path; + } + string projectRootPath = System.IO.Path.GetFullPath(Application.dataPath + "/../"); + return Path.Combine(projectRootPath, path); + } + } +} +#endif diff --git a/Editor/BuildProfile/WeixinMiniGameSettingsEditor.cs.meta b/Editor/BuildProfile/WeixinMiniGameSettingsEditor.cs.meta new file mode 100644 index 000000000..e15f7db37 --- /dev/null +++ b/Editor/BuildProfile/WeixinMiniGameSettingsEditor.cs.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: df4d545d2ba5ed176543212d06fd4afd +DefaultImporter: +externalObjects: {} +userData: +assetBundleName: +assetBundleVariant: \ No newline at end of file diff --git a/Editor/BuildProfile/WeixinSubplatformInterface.cs b/Editor/BuildProfile/WeixinSubplatformInterface.cs new file mode 100644 index 000000000..ae97bf9a4 --- /dev/null +++ b/Editor/BuildProfile/WeixinSubplatformInterface.cs @@ -0,0 +1,177 @@ +#if TUANJIE_1_4_OR_NEWER +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using UnityEditor; +using UnityEditor.Build.Profile; +using UnityEngine; +using UnityEngine.Rendering; + + +namespace WeChatWASM +{ + [InitializeOnLoad] + public static class WeixinSubTargetManager + { + static WeixinSubTargetManager() + { + MiniGameSubplatformManager.RegisterSubplatform(new WeixinSubplatformInterface()); + } + } + + public class WeixinSubplatformInterface : MiniGameSubplatformInterface + { + class CacheConfig + { + public WXProjectConf ProjectConf; + public SDKOptions SDKOptions; + public CompileOptions CompileOptions; + public CompressTexture CompressTexture; + public List PlayerPrefsKeys = new List(); + public FontOptions FontOptions; + } + + private CacheConfig cacheConfig = new CacheConfig(); + + public override string GetSubplatformName() + { + return "WeChat:微信小游戏"; + } + + public override MiniGameSettings GetSubplatformSettings() + { + return new WeixinMiniGameSettings(new WeixinMiniGameSettingsEditor()); + } + + public override BuildMiniGameError Build(BuildProfile buildProfile) + { + // Useless + return BuildMiniGameError.InvalidInput; + } + + public override BuildMiniGameError Build(BuildProfile buildProfile, BuildOptions options) + { + WeixinMiniGameSettings settings = buildProfile.miniGameSettings as WeixinMiniGameSettings; + + BuildMiniGameError buildMiniGameError = BuildMiniGameError.Unknown; + bool preprocessSuccess = WechatBuildPreprocess(buildProfile); + if (!preprocessSuccess) + { + return BuildMiniGameError.InvalidInput; + } + + if (settings is not null) + { + settings.FillAutoStreamingAutomatically(); + if (settings.PreprocessBuild(buildProfile, options)) + { + + var error = CallDoExport(buildProfile); + int enumIntValue = Convert.ToInt32(error); + switch (enumIntValue) + { + case 0: // SUCCEED + { + WeixinMiniGameSettings.AutoStreamingLoad(); + buildMiniGameError = BuildMiniGameError.Succeeded; + break; + } + case 2: // BUILD_WEBGL_FAILED + { + buildMiniGameError = BuildMiniGameError.PlayerBuildFailed; + break; + } + case 1: // NODE_NOT_FOUND + default: + { + buildMiniGameError = BuildMiniGameError.Unknown; + break; + } + } + } + } + BuildPostProcess(buildProfile); + return buildMiniGameError; + } + + private bool WechatBuildPreprocess(BuildProfile buildProfile) + { + // Check GFX API and Color Space + if (buildProfile != null) + { + PlayerSettings playerSettings = buildProfile.playerSettings; + // Global PlayerSettings + ColorSpace colorSpace = PlayerSettings.colorSpace; + GraphicsDeviceType[] apis = PlayerSettings.GetGraphicsAPIs(buildProfile.buildTarget); + bool isAutomatic = PlayerSettings.GetUseDefaultGraphicsAPIs(buildProfile.buildTarget); + + if (playerSettings != null) + { + // BuildProfile PlayerSettings Override + colorSpace = PlayerSettings.GetColorSpace_Internal(playerSettings); + apis = PlayerSettings.GetGraphicsAPIs_Internal(playerSettings, buildProfile.buildTarget); + isAutomatic = PlayerSettings.GetUseDefaultGraphicsAPIs_Internal(playerSettings, buildProfile.buildTarget); + + // set override templatePath + var absolutePath = Path.GetFullPath(Path.Combine("Packages", "com.qq.weixin.minigame", "WebGLTemplates/WXTemplate2022TJ")); + if (!Directory.Exists(absolutePath)) + absolutePath = Path.GetFullPath(Path.Combine(Application.dataPath, "WebGLTemplates/WXTemplate2022TJ")); + + if (Directory.Exists(absolutePath)) + PlayerSettings.MiniGame.SetTemplatePath_Internal(playerSettings, $"PATH:{absolutePath}"); + + PlayerSettings.MiniGame.SetThreadsSupport_Internal(playerSettings, false); + PlayerSettings.MiniGame.SetCompressionFormat_Internal(playerSettings, MiniGameCompressionFormat.Disabled); + PlayerSettings.MiniGame.SetLinkerTarget_Internal(playerSettings, MiniGameLinkerTarget.Wasm); + PlayerSettings.MiniGame.SetDataCaching_Internal(playerSettings, false); + PlayerSettings.MiniGame.SetDebugSymbolMode_Internal(playerSettings, MiniGameDebugSymbolMode.External); + PlayerSettings.SetRunInBackground_Internal(playerSettings, false); + } + return true; + } + else + { + throw new InvalidOperationException("Build profile has not been initialized."); + } + } + + private WXConvertCore.WXExportError CallDoExport(BuildProfile buildProfile) + { + WXEditorScriptObject config = UnityUtil.GetEditorConf(); + cacheConfig.ProjectConf = config.ProjectConf; + cacheConfig.SDKOptions = config.SDKOptions; + cacheConfig.CompileOptions = config.CompileOptions; + cacheConfig.CompressTexture = config.CompressTexture; + cacheConfig.PlayerPrefsKeys = config.PlayerPrefsKeys; + cacheConfig.FontOptions = config.FontOptions; + + WeixinMiniGameSettings weixinSettings = buildProfile.miniGameSettings as WeixinMiniGameSettings; + config.ProjectConf = weixinSettings.ProjectConf; + config.SDKOptions = weixinSettings.SDKOptions; + config.CompileOptions = weixinSettings.CompileOptions; + config.CompressTexture = weixinSettings.CompressTexture; + config.PlayerPrefsKeys = weixinSettings.PlayerPrefsKeys; + config.FontOptions = weixinSettings.FontOptions; + EditorUtility.SetDirty(config); + AssetDatabase.SaveAssets(); + return WXConvertCore.DoExport(); + } + + private void BuildPostProcess(BuildProfile buildProfile) + { + // Restore the original settings + WXEditorScriptObject config = UnityUtil.GetEditorConf(); + config.ProjectConf = cacheConfig.ProjectConf; + config.SDKOptions = cacheConfig.SDKOptions; + config.CompileOptions = cacheConfig.CompileOptions; + config.CompressTexture = cacheConfig.CompressTexture; + config.PlayerPrefsKeys = cacheConfig.PlayerPrefsKeys; + config.FontOptions = cacheConfig.FontOptions; + EditorUtility.SetDirty(config); + AssetDatabase.SaveAssets(); + } + + } +} +#endif diff --git a/Editor/BuildProfile/WeixinSubplatformInterface.cs.meta b/Editor/BuildProfile/WeixinSubplatformInterface.cs.meta new file mode 100644 index 000000000..67130b0d1 --- /dev/null +++ b/Editor/BuildProfile/WeixinSubplatformInterface.cs.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0b4df61ea34a9bc4c89a8e8b93455bd6 +DefaultImporter: +externalObjects: {} +userData: +assetBundleName: +assetBundleVariant: \ No newline at end of file diff --git a/Editor/BuildProfile/lib.meta b/Editor/BuildProfile/lib.meta index 87b4cc3cf..4a30858ee 100644 --- a/Editor/BuildProfile/lib.meta +++ b/Editor/BuildProfile/lib.meta @@ -1,8 +1,8 @@ fileFormatVersion: 2 -guid: XSwesi78AS28ymfR2HEhHpEBAC2DHupI1hIKP7HApjHRaZgGw+DTwWI= +guid: a100628dafec44bf49842a207d510696 folderAsset: yes DefaultImporter: externalObjects: {} userData: assetBundleName: - assetBundleVariant: + assetBundleVariant: \ No newline at end of file diff --git a/Editor/BuildProfile/lib/libwx-metal-cpp.bc b/Editor/BuildProfile/lib/libwx-metal-cpp.bc index e8ae12117..2a8e5683e 100644 Binary files a/Editor/BuildProfile/lib/libwx-metal-cpp.bc and b/Editor/BuildProfile/lib/libwx-metal-cpp.bc differ diff --git a/Editor/BuildProfile/lib/libwx-metal-cpp.bc.meta b/Editor/BuildProfile/lib/libwx-metal-cpp.bc.meta index 28e81d7a7..cd5e1bb7e 100644 --- a/Editor/BuildProfile/lib/libwx-metal-cpp.bc.meta +++ b/Editor/BuildProfile/lib/libwx-metal-cpp.bc.meta @@ -1,7 +1,93 @@ fileFormatVersion: 2 guid: c113acfee35db6b5c61fd4a76596cfd3 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 1 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude WindowsStoreApps: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + AndroidSharedLibraryType: Executable + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + WebGL: WebGL + second: + enabled: 0 + settings: {} + - first: + WeixinMiniGame: WeixinMiniGame + second: + enabled: 0 + settings: {} + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: false + PlaceholderPath: + SDK: AnySDK + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Editor/BuildProfile/lib/mtl_library.jslib b/Editor/BuildProfile/lib/mtl_library.jslib index b6f7cf5df..3a662c16c 100644 --- a/Editor/BuildProfile/lib/mtl_library.jslib +++ b/Editor/BuildProfile/lib/mtl_library.jslib @@ -2,26 +2,21 @@ mergeInto(LibraryManager.library, { // 定义供 C/C++ 调用的 JS 函数 js_batchRender_malloc: function(data, size, isSync) { // 直接从 WASM 内存创建视图(零拷贝) - const binaryData = new Uint8Array(Module.HEAPU8.buffer, data, size); - // 转换为标准 ArrayBuffer(如果需要复制) - const targetBuffer = - binaryData.buffer.slice(binaryData.byteOffset, binaryData.byteOffset + binaryData.byteLength); + const targetBuffer = new Uint8Array(Module.HEAPU8.buffer, data, size); //console.log("processBinaryData invoke"); - const extBuffer = new ArrayBuffer(1); - const headerBuffer = new ArrayBuffer(8); - const headerBufferView = new DataView(headerBuffer); - headerBufferView.setUint32(0, 0xDEC0DE, true); - headerBufferView.setUint32(4, mtl.ctx.__uid(), true); - const merged = new Uint8Array(headerBuffer.byteLength + targetBuffer.byteLength); - merged.set(new Uint8Array(headerBuffer), 0); - merged.set(new Uint8Array(targetBuffer), headerBuffer.byteLength); + const extBuffer = new ArrayBuffer(1); + if(!isSync){ - mtl.batchRenderAsync(merged.buffer, extBuffer); + mtl.batchRenderAsync(targetBuffer, extBuffer); return null; } - const result = mtl.batchRender(merged.buffer, extBuffer).buffer; - if(result.byteLength == 0){ - return null;; + const response = mtl.batchRender(targetBuffer, extBuffer); + if (!response) { + return null; + } + const result = response.buffer; + if(!result || result.byteLength == 0){ + return null; } // 申请内存空间,后续在cpp wasm部分使用,记得释放 const ptr = Module._malloc(result.byteLength); diff --git a/Editor/BuildProfile/lib/mtl_library.jslib.meta b/Editor/BuildProfile/lib/mtl_library.jslib.meta index 3882fefc8..fd1272a9f 100644 --- a/Editor/BuildProfile/lib/mtl_library.jslib.meta +++ b/Editor/BuildProfile/lib/mtl_library.jslib.meta @@ -1,7 +1,93 @@ fileFormatVersion: 2 guid: dda1926f3454e003333e8085a4f2c0fd -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 1 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude WindowsStoreApps: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + AndroidSharedLibraryType: Executable + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + WebGL: WebGL + second: + enabled: 0 + settings: {} + - first: + WeixinMiniGame: WeixinMiniGame + second: + enabled: 0 + settings: {} + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: false + PlaceholderPath: + SDK: AnySDK + ScriptingBackend: AnyScriptingBackend + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Editor/Playable/WXPlayableEditorSettingHelper.cs b/Editor/Playable/WXPlayableEditorSettingHelper.cs index 390e64623..382f08698 100644 --- a/Editor/Playable/WXPlayableEditorSettingHelper.cs +++ b/Editor/Playable/WXPlayableEditorSettingHelper.cs @@ -111,7 +111,7 @@ namespace WeChatWASM this.formCheckbox("developBuild", "Development Build", "", false, null, OnDevelopmentBuildToggleChanged); this.formCheckbox("il2CppOptimizeSize", "Il2Cpp Optimize Size(?)", "对应于Il2CppCodeGeneration选项,勾选时使用OptimizeSize(默认推荐),生成代码小15%左右,取消勾选则使用OptimizeSpeed。游戏中大量泛型集合的高频访问建议OptimizeSpeed,在使用HybridCLR等第三方组件时只能用OptimizeSpeed。(Dotnet Runtime模式下该选项无效)", !UseIL2CPP); this.formCheckbox("profilingFuncs", "Profiling Funcs"); - this.formCheckbox("webgl2", "WebGL2.0(beta)"); + this.formCheckbox("webgl2", "WebGL2.0"); EditorGUILayout.EndVertical(); } diff --git a/Editor/WXConvertCore.cs b/Editor/WXConvertCore.cs index 604d6c70f..b43838284 100644 --- a/Editor/WXConvertCore.cs +++ b/Editor/WXConvertCore.cs @@ -107,6 +107,14 @@ namespace WeChatWASM return config.CompileOptions.enableiOSMetal; } } + // 用于replaceRules判断是否需要注入相关的修改 + public static bool UseEmscriptenGLX + { + get + { + return config.CompileOptions.enableEmscriptenGLX; + } + } // public static void SetPlayableEnabled(bool enabled) // { // isPlayableBuild = enabled; @@ -126,6 +134,8 @@ namespace WeChatWASM } // iOS metal 的相关特性 ProcessWxiOSMetalBinaries(); + // emscriptenglx的相关特性 + ProcessWxEmscriptenGLXBinaries(); MakeEnvForLuaAdaptor(); // JSLib SettingWXTextureMinJSLib(); @@ -211,6 +221,9 @@ namespace WeChatWASM { var rootPath = Directory.GetParent(Application.dataPath).FullName; string webglDir = WXExtEnvDef.GETDEF("WEIXINMINIGAME") ? "WeixinMiniGame" : "WebGL"; +#if PLATFORM_PLAYABLEADS + webglDir = "PlayableAds"; +#endif symFile1 = Path.Combine(rootPath, "Library", "Bee", "artifacts", webglDir, "build", "debug_WebGL_wasm", "build.js.symbols"); } WeChatWASM.UnityUtil.preprocessSymbols(symFile1, GetWebGLSymbolPath()); @@ -272,8 +285,8 @@ namespace WeChatWASM } catch (Exception ex) { - UnityEngine.Debug.LogError($"Failed to get enabled flag string index: {ex.Message}"); - throw; + UnityEngine.Debug.LogWarning($"Failed to get enabled flag string index: {ex.Message}"); + return -1; // -1 means failed } } @@ -302,7 +315,8 @@ namespace WeChatWASM } catch (Exception ex) { - UnityEngine.Debug.LogError($"Failed to enable plugin asset: {ex.Message}"); + // 避免 Error 日志阻塞打包流程 + UnityEngine.Debug.LogWarning($"Failed to enable plugin asset: {ex.Message}"); } } @@ -335,7 +349,9 @@ namespace WeChatWASM { // WxPerfJsBridge.jslib var wxPerfJSBridgeImporter = AssetImporter.GetAtPath(wxPerfPlugins[0]) as PluginImporter; -#if PLATFORM_WEIXINMINIGAME +#if PLATFORM_PLAYABLEADS + wxPerfJSBridgeImporter.SetCompatibleWithPlatform(BuildTarget.PlayableAds, config.CompileOptions.enablePerfAnalysis); +#elif PLATFORM_WEIXINMINIGAME wxPerfJSBridgeImporter.SetCompatibleWithPlatform(BuildTarget.WeixinMiniGame, config.CompileOptions.enablePerfAnalysis); #else wxPerfJSBridgeImporter.SetCompatibleWithPlatform(BuildTarget.WebGL, config.CompileOptions.enablePerfAnalysis); @@ -348,7 +364,10 @@ namespace WeChatWASM bool bShouldEnablePerf2022Plugin = config.CompileOptions.enablePerfAnalysis && IsCompatibleWithUnity202203OrNewer(); var wxPerf2022Importer = AssetImporter.GetAtPath(wxPerfPlugins[1]) as PluginImporter; -#if PLATFORM_WEIXINMINIGAME + +#if PLATFORM_PLAYABLEADS + wxPerf2022Importer.SetCompatibleWithPlatform(BuildTarget.PlayableAds, bShouldEnablePerf2022Plugin); +#elif PLATFORM_WEIXINMINIGAME wxPerf2022Importer.SetCompatibleWithPlatform(BuildTarget.WeixinMiniGame, bShouldEnablePerf2022Plugin); #else wxPerf2022Importer.SetCompatibleWithPlatform(BuildTarget.WebGL, bShouldEnablePerf2022Plugin); @@ -361,7 +380,9 @@ namespace WeChatWASM bool bShouldEnablePerf2021Plugin = config.CompileOptions.enablePerfAnalysis && IsCompatibleWithUnity202102To202203(); var wxPerf2021Importer = AssetImporter.GetAtPath(wxPerfPlugins[2]) as PluginImporter; -#if PLATFORM_WEIXINMINIGAME +#if PLATFORM_PLAYABLEADS + wxPerf2021Importer.SetCompatibleWithPlatform(BuildTarget.PlayableAds, bShouldEnablePerf2021Plugin); +#elif PLATFORM_WEIXINMINIGAME wxPerf2021Importer.SetCompatibleWithPlatform(BuildTarget.WeixinMiniGame, bShouldEnablePerf2021Plugin); #else wxPerf2021Importer.SetCompatibleWithPlatform(BuildTarget.WebGL, bShouldEnablePerf2021Plugin); @@ -371,6 +392,59 @@ namespace WeChatWASM AssetDatabase.Refresh(); } + private static void ProcessWxEmscriptenGLXBinaries() + { + string[] glLibs; + string DS = WXAssetsTextTools.DS; + if (UnityUtil.GetSDKMode() == UnityUtil.SDKMode.Package) + { + glLibs = new string[] + { + $"Packages{DS}com.qq.weixin.minigame{DS}Runtime{DS}Plugins{DS}libemscriptenglx.a", + $"Packages{DS}com.qq.weixin.minigame{DS}Runtime{DS}Plugins{DS}libemscriptenglx_2021.a", + }; + } + else + { + string glLibRootDir = $"Assets{DS}WX-WASM-SDK-V2{DS}Runtime{DS}Plugins{DS}"; + + // 下方顺序不要变动 + glLibs = new string[] + { + $"{glLibRootDir}libemscriptenglx.a", + $"{glLibRootDir}libemscriptenglx_2021.a", + }; + } + + { + // unity2022, tuanjie lib引入 + bool showEnableGLX2022Plugin = config.CompileOptions.enableEmscriptenGLX && IsCompatibleWithUnity202203OrNewer(); + + var glx2022Importer = AssetImporter.GetAtPath(glLibs[0]) as PluginImporter; + #if PLATFORM_WEIXINMINIGAME + glx2022Importer.SetCompatibleWithPlatform(BuildTarget.WeixinMiniGame, showEnableGLX2022Plugin); + #else + glx2022Importer.SetCompatibleWithPlatform(BuildTarget.WebGL, showEnableGLX2022Plugin); + #endif + SetPluginCompatibilityByModifyingMetadataFile(glLibs[0], showEnableGLX2022Plugin); + } + + { + // unity2021 lib引入 + bool showEnableGLX2021Plugin = config.CompileOptions.enableEmscriptenGLX && IsCompatibleWithUnity202102To202203(); + + var glx2021Importer = AssetImporter.GetAtPath(glLibs[1]) as PluginImporter; + #if PLATFORM_WEIXINMINIGAME + glx2021Importer.SetCompatibleWithPlatform(BuildTarget.WeixinMiniGame, showEnableGLX2021Plugin); + #else + glx2021Importer.SetCompatibleWithPlatform(BuildTarget.WebGL, showEnableGLX2021Plugin); + #endif + SetPluginCompatibilityByModifyingMetadataFile(glLibs[1], showEnableGLX2021Plugin); + } + + AssetDatabase.Refresh(); + } + /** * Lua Adaptor Settings. */ @@ -508,7 +582,9 @@ namespace WeChatWASM Debug.LogError("Lua Adaptor Importer Not Found: " + maybeBuildFile); continue; } -#if PLATFORM_WEIXINMINIGAME +#if PLATFORM_PLAYABLEADS + wxPerfJSBridgeImporter.SetCompatibleWithPlatform(BuildTarget.PlayableAds, shouldBuild); +#elif PLATFORM_WEIXINMINIGAME wxPerfJSBridgeImporter.SetCompatibleWithPlatform(BuildTarget.WeixinMiniGame, shouldBuild); #else wxPerfJSBridgeImporter.SetCompatibleWithPlatform(BuildTarget.WebGL, shouldBuild); @@ -558,7 +634,12 @@ namespace WeChatWASM else { #if TUANJIE_2022_3_OR_NEWER - EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.WeixinMiniGame, BuildTarget.WeixinMiniGame); + if(EditorUserBuildSettings.activeBuildTarget != BuildTarget.WeixinMiniGame +#if PLATFORM_PLAYABLEADS + && EditorUserBuildSettings.activeBuildTarget != BuildTarget.PlayableAds +#endif + ) + EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.WeixinMiniGame, BuildTarget.WeixinMiniGame); #endif } Emit(LifeCycle.afterSwitchActiveBuildTarget); @@ -880,6 +961,22 @@ namespace WeChatWASM } } + { + Rule[] rules = + { + new Rule() + { + old = "if (GameGlobal.unityNamespace.enableProfileStats)", + newStr = "if (GameGlobal.unityNamespace.enableProfileStats || (typeof GameGlobal.manager.getWXAppCheatMonitor === 'function' && GameGlobal.manager.getWXAppCheatMonitor().shouldForceShowPerfMonitor()))" + } + }; + foreach (var rule in rules) + { + text = text.Replace(rule.old, rule.newStr); + } + } + + File.WriteAllText(targetPath, text, new UTF8Encoding(false)); UnityEngine.Debug.LogFormat("[Converter] adapt framework done! "); @@ -1015,7 +1112,11 @@ namespace WeChatWASM } #endif #if TUANJIE_2022_3_OR_NEWER - if (EditorUserBuildSettings.activeBuildTarget != BuildTarget.WeixinMiniGame) + if (EditorUserBuildSettings.activeBuildTarget != BuildTarget.WeixinMiniGame +#if PLATFORM_PLAYABLEADS + && EditorUserBuildSettings.activeBuildTarget != BuildTarget.PlayableAds +#endif + ) { UnityEngine.Debug.LogFormat("[Builder] Current target is: {0}, switching to: {1}", EditorUserBuildSettings.activeBuildTarget, BuildTarget.WeixinMiniGame); if (!EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.WeixinMiniGame, BuildTarget.WeixinMiniGame)) @@ -1026,8 +1127,11 @@ namespace WeChatWASM } var projDir = Path.Combine(config.ProjectConf.DST, webglDir); - +#if PLATFORM_PLAYABLEADS + var result = BuildPipeline.BuildPlayer(GetScenePaths(), projDir, BuildTarget.PlayableAds, option); +#else var result = BuildPipeline.BuildPlayer(GetScenePaths(), projDir, BuildTarget.WeixinMiniGame, option); +#endif if (result.summary.result != UnityEditor.Build.Reporting.BuildResult.Succeeded) { UnityEngine.Debug.LogFormat("[Builder] BuildPlayer failed. emscriptenArgs:{0}", PlayerSettings.WeixinMiniGame.emscriptenArgs); @@ -1966,7 +2070,7 @@ namespace WeChatWASM config.ProjectConf.bundleHashLength.ToString(), bundlePathIdentifierStr, excludeFileExtensionsStr, - config.CompileOptions.enableiOSMetal ? "5" : (config.CompileOptions.Webgl2 ? "2" : "1"), + config.CompileOptions.Webgl2 ? "2" : "1", Application.unityVersion, WXExtEnvDef.pluginVersion, config.ProjectConf.dataFileSubPrefix, @@ -2015,7 +2119,9 @@ namespace WeChatWASM config.ProjectConf.MemorySize.ToString(), config.SDKOptions.disableMultiTouch ? "true" : "false", // Perfstream,暂时设为false - "false" + "false", + config.CompileOptions.enableEmscriptenGLX ? "true" : "false", + config.CompileOptions.enableiOSMetal ? "true" : "false" }); List replaceList = new List(replaceArrayList); @@ -2164,7 +2270,9 @@ namespace WeChatWASM { var importer = AssetImporter.GetAtPath(jsLibs[i]) as PluginImporter; bool value = i == index; -#if PLATFORM_WEIXINMINIGAME +#if PLATFORM_PLAYABLEADS + importer.SetCompatibleWithPlatform(BuildTarget.PlayableAds, value); +#elif PLATFORM_WEIXINMINIGAME importer.SetCompatibleWithPlatform(BuildTarget.WeixinMiniGame, value); #else importer.SetCompatibleWithPlatform(BuildTarget.WebGL, value); diff --git a/Editor/WXEditorSettingHelper.cs b/Editor/WXEditorSettingHelper.cs index 8fd180662..c6f91baae 100644 --- a/Editor/WXEditorSettingHelper.cs +++ b/Editor/WXEditorSettingHelper.cs @@ -183,9 +183,10 @@ namespace WeChatWASM this.formCheckbox("il2CppOptimizeSize", "Il2Cpp Optimize Size(?)", "对应于Il2CppCodeGeneration选项,勾选时使用OptimizeSize(默认推荐),生成代码小15%左右,取消勾选则使用OptimizeSpeed。游戏中大量泛型集合的高频访问建议OptimizeSpeed,在使用HybridCLR等第三方组件时只能用OptimizeSpeed。(Dotnet Runtime模式下该选项无效)", !UseIL2CPP); this.formCheckbox("profilingFuncs", "Profiling Funcs"); this.formCheckbox("profilingMemory", "Profiling Memory"); - this.formCheckbox("webgl2", "WebGL2.0(beta)"); + this.formCheckbox("webgl2", "WebGL2.0"); this.formCheckbox("iOSPerformancePlus", "iOSPerformancePlus(?)", "是否使用iOS高性能+渲染方案,有助于提升渲染兼容性、降低WebContent进程内存"); - // this.formCheckbox("iOSMetal", "iOSMetal(?)", "是否使用iOSMetal渲染方案,需要开启iOS高性能+模式,有助于提升运行性能,降低iOS功耗"); + this.formCheckbox("EmscriptenGLX", "EmscriptenGLX(?)", "是否使用EmscriptenGLX渲染方案"); + this.formCheckbox("iOSMetal", "iOSMetal(?)", "是否使用iOSMetal渲染方案,需要开启iOS高性能+模式,有助于提升运行性能,降低iOS功耗"); this.formCheckbox("deleteStreamingAssets", "Clear Streaming Assets"); this.formCheckbox("cleanBuild", "Clean WebGL Build"); // this.formCheckbox("cleanCloudDev", "Clean Cloud Dev"); @@ -449,6 +450,7 @@ namespace WeChatWASM this.setData("webgl2", config.CompileOptions.Webgl2); this.setData("iOSPerformancePlus", config.CompileOptions.enableIOSPerformancePlus); this.setData("iOSMetal", config.CompileOptions.enableiOSMetal); + this.setData("EmscriptenGLX", config.CompileOptions.enableEmscriptenGLX); this.setData("fbslim", config.CompileOptions.fbslim); this.setData("useFriendRelation", config.SDKOptions.UseFriendRelation); this.setData("useMiniGameChat", config.SDKOptions.UseMiniGameChat); @@ -528,6 +530,7 @@ namespace WeChatWASM config.CompileOptions.Webgl2 = this.getDataCheckbox("webgl2"); config.CompileOptions.enableIOSPerformancePlus = this.getDataCheckbox("iOSPerformancePlus"); config.CompileOptions.enableiOSMetal = this.getDataCheckbox("iOSMetal"); + config.CompileOptions.enableEmscriptenGLX = this.getDataCheckbox("EmscriptenGLX"); config.CompileOptions.fbslim = this.getDataCheckbox("fbslim"); config.SDKOptions.UseFriendRelation = this.getDataCheckbox("useFriendRelation"); config.SDKOptions.UseMiniGameChat = this.getDataCheckbox("useMiniGameChat"); diff --git a/Editor/WXExtDef.cs b/Editor/WXExtDef.cs index 08a5888e4..54f139a28 100644 --- a/Editor/WXExtDef.cs +++ b/Editor/WXExtDef.cs @@ -129,6 +129,10 @@ namespace WeChatWASM { return WXConvertCore.UseiOSMetal; }); + WXExtEnvDef.RegisterAction("WXConvertCore.UseEmscriptenGLX", (args) => + { + return WXConvertCore.UseEmscriptenGLX; + }); WXExtEnvDef.RegisterAction("UnityUtil.GetWxSDKRootPath", (args) => { #if UNITY_2018 diff --git a/Editor/WXPluginVersion.cs b/Editor/WXPluginVersion.cs index 91c76e5c1..4dc091e2c 100644 --- a/Editor/WXPluginVersion.cs +++ b/Editor/WXPluginVersion.cs @@ -2,7 +2,7 @@ namespace WeChatWASM { public class WXPluginVersion { - public static string pluginVersion = "202507300820"; // 这一行不要改他,导出的时候会自动替换 + public static string pluginVersion = "202512040623"; // 这一行不要改他,导出的时候会自动替换 } public class WXPluginConf diff --git a/Editor/wx-editor.dll b/Editor/wx-editor.dll index ea91717d9..df01a93a3 100644 Binary files a/Editor/wx-editor.dll and b/Editor/wx-editor.dll differ diff --git a/Editor/wx-editor.xml b/Editor/wx-editor.xml index 8bd12eb5f..71eca6215 100644 --- a/Editor/wx-editor.xml +++ b/Editor/wx-editor.xml @@ -653,6 +653,7 @@ 是否使用iOS metal指令流 + 是否使用brotli多线程压缩 diff --git a/Editor/wx-editor.xml.meta b/Editor/wx-editor.xml.meta index 63de98129..b7d75f4f2 100644 --- a/Editor/wx-editor.xml.meta +++ b/Editor/wx-editor.xml.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 1b94c242fc37a08a874cb51e273085a1 +guid: 0f8b919a5dd00386ffcd28a86c68eeb7 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/DisableKeyboardInput.cs b/Runtime/DisableKeyboardInput.cs index fa300352b..a0cc2330e 100644 --- a/Runtime/DisableKeyboardInput.cs +++ b/Runtime/DisableKeyboardInput.cs @@ -10,7 +10,9 @@ internal class DisableKeyboardInput : MonoBehaviour private static void OnGameLaunch() { #if !UNITY_EDITOR -#if PLATFORM_WEIXINMINIGAME +#if PLATFORM_PLAYABLEADS + PlayableAdsInput.mobileKeyboardSupport = false; +#elif PLATFORM_WEIXINMINIGAME WeixinMiniGameInput.mobileKeyboardSupport = false; #elif PLATFORM_WEBGL #if UNITY_2022_1_OR_NEWER diff --git a/Runtime/Plugins/SDK-Call-JS-Old.jslib b/Runtime/Plugins/SDK-Call-JS-Old.jslib index 09d9ec303..b22e40206 100755 --- a/Runtime/Plugins/SDK-Call-JS-Old.jslib +++ b/Runtime/Plugins/SDK-Call-JS-Old.jslib @@ -627,6 +627,9 @@ mergeInto(LibraryManager.library, { stringToUTF8(returnStr, buffer, bufferSize); return buffer; }, + WXSetSyncReadCacheEnabled: function(enabled) { + window.WXWASMSDK.WXSetSyncReadCacheEnabled(enabled); + }, WXGetPluginCachePath: function() { var returnStr = window.WXWASMSDK.WXGetPluginCachePath(); var bufferSize = lengthBytesUTF8(returnStr || '') + 1; diff --git a/Runtime/Plugins/WXAssetBundle.jslib b/Runtime/Plugins/WXAssetBundle.jslib index ab24b88e2..30fa916c2 100644 --- a/Runtime/Plugins/WXAssetBundle.jslib +++ b/Runtime/Plugins/WXAssetBundle.jslib @@ -51,6 +51,7 @@ var WXAssetBundleLibrary = { WXFS.msg = ""; WXFS.fd2wxStream = new Map; WXFS.path2fd = new Map; + WXFS.refRecord = new Map; WXFS.fs = wx.getFileSystemManager(); WXFS.nowfd = FS.MAX_OPEN_FDS + 1; WXFS.isWXAssetBundle = function(url){ @@ -98,18 +99,6 @@ var WXAssetBundleLibrary = { value: function get(key) { var temp = this.hash.get(key); if (temp !== undefined) { - if(temp.cleanable && unityNamespace.isAndroid && temp.time + this.ttl * 1000 < Date.now()){ - try { - var check_path = WXFS.fd2wxStream.get(key).path - if(!GameGlobal.manager.getCachePath(check_path)){ - throw new Error("No such file in the wx cache system") - } - WXFS.fs.statSync(check_path) - } catch (e) { - GameGlobal.manager.reporter.wxAssetBundle.reportEmptyContent({stage: WXFS.WXABErrorSteps['kCacheGet'], path: check_path, error: !!e ? e.toString() : 'unknown'}); - GameGlobal.manager.Logger.pluginLog('[WXAssetBundle]Android statSync path: ' + check_path + ' error: ' + (!!e ? e.toString() : 'unknown')); - } - } this.hash.delete(key); temp.time = Date.now(); this.hash.set(key, temp); @@ -320,6 +309,9 @@ var WXAssetBundleLibrary = { } if(!WXFS.disk.has(path)){ WXFS.disk.set(path, 0); + WXFS.refRecord.set(path, 1); + } else { + WXFS.refRecord.set(path, WXFS.refRecord.get(path) + 1); } return true; }, @@ -327,11 +319,17 @@ var WXAssetBundleLibrary = { UnloadbyPath: function (ptr) { var path = WXFS.url2path(UTF8ToString(ptr)); var fd = WXFS.path2fd.get(path); - if(WXFS.cache.has(fd)){ - WXFS.cache.delete(fd); - } - if(WXFS.disk.has(path)){ - WXFS.disk.delete(path); + var refCount = WXFS.refRecord.get(path); + if(!refCount) return; + refCount -= 1; + WXFS.refRecord.set(path, refCount); + if(!refCount){ + if(WXFS.cache.has(fd)){ + WXFS.cache.delete(fd); + } + if(WXFS.disk.has(path)){ + WXFS.disk.delete(path); + } } }, diff --git a/Runtime/Plugins/WxGameDataMonitor.jslib b/Runtime/Plugins/WxGameDataMonitor.jslib index f9b504c7f..909f639f2 100644 --- a/Runtime/Plugins/WxGameDataMonitor.jslib +++ b/Runtime/Plugins/WxGameDataMonitor.jslib @@ -1,5 +1,6 @@ mergeInto(LibraryManager.library, { JSStartGameDataMonitor: function() { + if (!Module.IsWxGame) return; console.log("call JSStartGameDataMonitor \n"); if (typeof GameGlobal.manager.getGameDataMonitor === 'function') diff --git a/Runtime/Plugins/libemscriptenglx.a b/Runtime/Plugins/libemscriptenglx.a new file mode 100644 index 000000000..30c9ac8d6 Binary files /dev/null and b/Runtime/Plugins/libemscriptenglx.a differ diff --git a/Runtime/Plugins/libemscriptenglx.a.meta b/Runtime/Plugins/libemscriptenglx.a.meta new file mode 100644 index 000000000..5b0cafb3a --- /dev/null +++ b/Runtime/Plugins/libemscriptenglx.a.meta @@ -0,0 +1,74 @@ +fileFormatVersion: 2 +guid: cccbd1d680cfe34fa1fef9e4875e5f23 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 1 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Editor: 0 + Exclude Linux64: 0 + Exclude OSXUniversal: 0 + Exclude WeixinMiniGame: 0 + Exclude Win: 0 + Exclude Win64: 0 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: OSXUniversal + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + WebGL: WebGL + second: + enabled: 1 + settings: {} + - first: + WeixinMiniGame: WeixinMiniGame + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Plugins/libemscriptenglx_2021.a b/Runtime/Plugins/libemscriptenglx_2021.a new file mode 100644 index 000000000..145e16a5f Binary files /dev/null and b/Runtime/Plugins/libemscriptenglx_2021.a differ diff --git a/Runtime/Plugins/libemscriptenglx_2021.a.meta b/Runtime/Plugins/libemscriptenglx_2021.a.meta new file mode 100644 index 000000000..005cde2bd --- /dev/null +++ b/Runtime/Plugins/libemscriptenglx_2021.a.meta @@ -0,0 +1,93 @@ +fileFormatVersion: 2 +guid: 89ccba97a8e2991dc502c741bc8cd6c6 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 1 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Android: 1 + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 1 + Exclude Win: 1 + Exclude Win64: 1 + Exclude WindowsStoreApps: 1 + - first: + Android: Android + second: + enabled: 0 + settings: + AndroidSharedLibraryType: Executable + CPU: ARMv7 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + WebGL: WebGL + second: + enabled: 0 + settings: {} + - first: + WeixinMiniGame: WeixinMiniGame + second: + enabled: 0 + settings: {} + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + DontProcess: false + PlaceholderPath: + SDK: AnySDK + ScriptingBackend: AnyScriptingBackend +userData: +assetBundleName: +assetBundleVariant: diff --git a/Runtime/Plugins/wx-perf.dll b/Runtime/Plugins/wx-perf.dll index 6b8f0e0cc..a3eaea395 100644 Binary files a/Runtime/Plugins/wx-perf.dll and b/Runtime/Plugins/wx-perf.dll differ diff --git a/Runtime/Plugins/wx-perf.dll.meta b/Runtime/Plugins/wx-perf.dll.meta index 01f86625f..99b128da8 100644 --- a/Runtime/Plugins/wx-perf.dll.meta +++ b/Runtime/Plugins/wx-perf.dll.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ffcf22f69c45d4919a04626e60e86c20 +guid: f0cbdcf50f6d52cea758f1ea825443c0 PluginImporter: externalObjects: {} serializedVersion: 2 @@ -7,21 +7,68 @@ PluginImporter: executionOrder: {} defineConstraints: [] isPreloaded: 0 - isOverridable: 0 + isOverridable: 1 isExplicitlyReferenced: 0 validateReferences: 1 platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Editor: 0 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude WebGL: 0 + Exclude Win: 1 + Exclude Win64: 1 - first: Any: second: - enabled: 1 + enabled: 0 settings: {} - first: Editor: Editor + second: + enabled: 1 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Standalone: Linux64 second: enabled: 0 settings: - DefaultValueInitialized: true + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + WebGL: WebGL + second: + enabled: 1 + settings: {} + - first: + WeixinMiniGame: WeixinMiniGame + second: + enabled: 1 + settings: {} - first: Windows Store Apps: WindowsStoreApps second: diff --git a/Runtime/Plugins/wx-runtime-editor.dll b/Runtime/Plugins/wx-runtime-editor.dll index 2cb3acdcd..d636c3734 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 2f1482e27..64b02fa45 100644 --- a/Runtime/Plugins/wx-runtime-editor.xml +++ b/Runtime/Plugins/wx-runtime-editor.xml @@ -3119,6 +3119,17 @@  是否结束 + + + 错误码,文档可见 https://developers.weixin.qq.com/minigame/dev/api/open-api/openlink/wx.createPageManager.html + + + + + 错误信息 + + + 从不同渠道获得的OPENLINK字符串 @@ -3139,6 +3150,12 @@ 选填,部分活动、功能允许接收自定义query参数,请参阅渠道说明,默认可不填 + + + 结果对象的json字符串,各项为实验的相关信息 + + + 错误信息 @@ -3589,6 +3606,26 @@ 宽度,单位:px + + + 通知组件信息 + + + + + 组件的布局位置信息 + + + + + 组件是否显示 + + + + + 组件的名称 + + 当前占用的空间大小, 单位 KB @@ -3911,7 +3948,7 @@ - 是否开启 profile,默认开启。开启后可在接口回调的 res.profile 中查看性能调试信息。 + 是否开启 profile。iOS 和 Android 端默认开启,其他端暂不支持。开启后可在接口回调的 res.profile 中查看性能调试信息。 @@ -3937,12 +3974,6 @@ 超时时间,单位为毫秒,默认值为 60000 即一分钟。 - - - 需要基础库: `3.4.1` - 使用高性能模式,暂仅支持 Android,默认关闭。该模式下有更优的网络性能表现。 - - 错误信息 @@ -3956,7 +3987,7 @@ 需要基础库: `2.10.4` - 网络请求过程中一些调试信息,[查看详细说明](https://developers.weixin.qq.com/miniprogram/dev/framework/performance/network.html) + 网络请求过程中一些调试信息,[查看详细说明](https://developers.weixin.qq.com/miniprogram/dev/framework/performance/network.html)。目前 iOS 和 Android 端支持。 @@ -3991,12 +4022,12 @@ - DNS 域名查询完成的时间,如果使用了本地缓存(即无 DNS 查询)或持久连接,则与 fetchStart 值相等 + Local DNS 域名查询完成的时间,如果使用了本地缓存(即无 DNS 查询)或持久连接,则与 fetchStart 值相等 - DNS 域名查询开始的时间,如果使用了本地缓存(即无 DNS 查询)或持久连接,则与 fetchStart 值相等 + Local DNS 域名查询开始的时间,如果使用了本地缓存(即无 DNS 查询)或持久连接,则与 fetchStart 值相等 @@ -4014,11 +4045,29 @@ 组件准备好使用 HTTP 请求抓取资源的时间,这发生在检查本地缓存之前 + + + 需要基础库: `3.8.9` + httpDNS 完成查询的时间。仅当开启 httpDNS 功能时返回该字段。目前仅wx.request接口支持 + + + + + 需要基础库: `3.8.9` + httpDNS 开始查询的时间。仅当开启 httpDNS 功能时返回该字段。目前仅wx.request接口支持 + + 协议层根据多个请求评估当前网络的 rtt(仅供参考) + + + 需要基础库: `3.8.10` + 调用接口的时间。 + + 当前请求的IP @@ -4034,6 +4083,18 @@ 使用协议类型,有效值:http1.1, h2, quic, unknown + + + 需要基础库: `3.8.10` + 结束排队的时间。达到并行上限时才需要排队。如果未发生排队,则该字段和 queueStart 字段值相同 + + + + + 需要基础库: `3.8.10` + 开始排队的时间。达到并行上限时才需要排队。 + + 收到字节数 @@ -5534,6 +5595,26 @@ 预告状态:0可用 1取消 2已用 + + + 敏感数据对应的云 ID,开通[云开发](https://developers.weixin.qq.com/minigame/dev/wxcloud/basis/getting-started.html)的小程序才会返回,可通过云调用直接获取开放数据,详细见[云调用直接获取开放数据](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#method-cloud) + + + + + 包括敏感数据在内的完整转发信息的加密数据,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) + + + + + 错误信息 + + + + + 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) + + 剪贴板的内容 @@ -5619,6 +5700,11 @@ 使用 sha1( rawData + sessionkey ) 得到字符串,用于校验用户信息 + + + 实验参数数组,不填则获取所有实验参数 + + 需要基础库: `3.7.8` @@ -5670,6 +5756,56 @@ 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) + + + 需要获取的群用户的 groupOpenId 列表 + + + + + 所选用户的头像昵称列表 + + + + + 用户头像图片 url + + + + + 用户所在城市 + + + + + 用户所在国家 + + + + + 用户性别 + + + + + 显示 country province city 所用的语言 + + + + + 用户昵称 + + + + + 用户 openId + + + + + 用户所在省份 + + AI推理引擎版本 @@ -5805,17 +5941,6 @@ - itemSettings 只返回用户勾选过订阅面板中的“总是保持以上选择,不再询问”的订阅消息。 - - - shareTicket,详见[获取更多转发信息](#) - - - - - 需要基础库: `1.9.90` - 超时时间,单位 ms - - 封面广告组件展示状态码 @@ -6103,12 +6228,12 @@ 超时时间,单位ms - + 错误信息 - + 需要基础库: `2.24.0` errno 错误码,错误码的详细说明参考 [Errno错误码](https://developers.weixin.qq.com/minigame/dev/guide/runtime/debug/PublicErrno.html) @@ -6155,7 +6280,7 @@ - 需要传递给目标小程序的数据,目标小程序可在 `App.onLaunch`,`App.onShow` 中获取到这份数据。如果跳转的是小游戏,可以在 [wx.onShow](https://developers.weixin.qq.com/minigame/dev/api/base/app/life-cycle/wx.onShow.html)、[wx.getLaunchOptionsSync](https://developers.weixin.qq.com/minigame/dev/api/base/app/life-cycle/wx.getLaunchOptionsSync.html) 中可以获取到这份数据数据。 + 需要传递给目标小程序的数据,目标小程序可在 `App.onLaunch`,`App.onShow` 中获取到这份数据。如果跳转的是小游戏,可以在 [wx.onShow](https://developers.weixin.qq.com/minigame/dev/api/base/app/life-cycle/wx.onShow.html)、[wx.getLaunchOptionsSync](https://developers.weixin.qq.com/minigame/dev/api/base/app/life-cycle/wx.getLaunchOptionsSync.html) 中可以获取到这份数据。 @@ -6201,6 +6326,25 @@ 设置特征订阅类型,有效值有 `notification` 和 `indication` + + + + 需要提醒的用户 group_openid 列表 + + + + + 文字链标题,发送的内容将由微信拼接为:@的成员列表+“请完成:”/"请参与:"+打开小程序的文字链,如「@alex @cindy 请完成:团建报名统计」。 + + + + + 展示的动词 + 可选值: + - 'participate': 请参与; + - 'complete': 请完成; + + X 轴 @@ -6366,14 +6510,9 @@ - 'landscapeReverse': 横屏反方向,以 HOME 键在屏幕左侧为反方向; - + - 错误 - - - - - 错误调用堆栈 + 错误信息,包含堆栈 @@ -6498,6 +6637,11 @@ 当前是否处于弱网状态 + + + 全部组件的信息 + + 录屏状态 @@ -6691,6 +6835,14 @@ 变化后的窗口宽度,单位 px + + + 改变的窗口状态,可能的值为: + - 'minimize':窗口最小化 + - 'normalize':窗口恢复正常尺寸 + - 'maximize':窗口最大化 + + 需要基础库: `2.10.0` @@ -6721,6 +6873,11 @@ 视频号 id,以“sph”开头的id,可在视频号助手获取 + + + 视频号的Feed的nonceId,必填 + + 活动 id @@ -6751,6 +6908,21 @@ 视频号 id + + + 群聊类型 + 可选值: + - 1: 微信联系人单聊; + - 2: 企业微信联系人单聊; + - 3: 普通微信群聊; + - 4: 企业微信互通群聊; + + + + + 聊天室 id,不传则拉起群选择框,可以传入多聊群的 opengid 值,或者单聊群的 open_single_roomid 值 + + 企业ID @@ -7147,26 +7319,6 @@ | -10073015 | | 索要功能不可用 | - - - 敏感数据对应的云 ID,开通[云开发](https://developers.weixin.qq.com/minigame/dev/wxcloud/basis/getting-started.html)的小程序才会返回,可通过云调用直接获取开放数据,详细见[云调用直接获取开放数据](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#method-cloud) - - - - - 包括敏感数据在内的完整转发信息的加密数据,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) - - - - - 错误信息 - - - - - 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) - - 币种 @@ -7426,6 +7578,16 @@ - 'CODE_25': 一维码; + + + 最多可选人数 + + + + + 所选用户在此聊天室下的唯一标识,同一个用户在不同的聊天室下id不同 + + 蓝牙设备 id @@ -7559,6 +7721,66 @@ 是否转发到当前群。该参数只对从群工具栏打开的场景下生效,默认转发到当前群,填入false时可转发到其他会话。 + + + 转发标题 + + + + + 自定义图片路径,支持PNG及JPG,显示图片长宽比是 5:4,默认使用截图 + + + + + + 要分享的表情地址,必须为本地路径或临时路径 + + + + + + 分享的表情消息是否要带小程序入口 + + + + + 要分享的图片地址,必须为本地路径或临时路径 + + + + + + 分享的图片消息是否要带小程序入口 + + + + + 要分享的文本内容 + + + + + + 分享的表情消息是否要带小程序入口 + + + + + 要分享的视频地址,必须为本地路径或临时路径 + + + + + + 分享的图片消息是否要带小程序入口 + + + + + 缩略图路径,若留空则使用视频首帧 + + 按钮的文字数组,数组长度最大为 6 @@ -7601,6 +7823,14 @@ 键盘输入框显示的默认值 + + + 键盘类型,默认为文本类型,客户端8.0.57以上支持数字键盘 + 可选值: + - 'text': 文本; + - 'number': 数字; + + 键盘中文本的最大长度 diff --git a/Runtime/Plugins/wx-runtime-editor.xml.meta b/Runtime/Plugins/wx-runtime-editor.xml.meta index 4e1e7606f..fdf5f7f93 100644 --- a/Runtime/Plugins/wx-runtime-editor.xml.meta +++ b/Runtime/Plugins/wx-runtime-editor.xml.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 882bc04407b4d8217e597652f26bfb81 +guid: 50e8037b070a830cd4772972a5d44265 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/Plugins/wx-runtime.dll b/Runtime/Plugins/wx-runtime.dll index 57ecf96bf..9f2adc66f 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 482a88a22..1838a1584 100644 --- a/Runtime/Plugins/wx-runtime.xml +++ b/Runtime/Plugins/wx-runtime.xml @@ -3125,6 +3125,17 @@  是否结束 + + + 错误码,文档可见 https://developers.weixin.qq.com/minigame/dev/api/open-api/openlink/wx.createPageManager.html + + + + + 错误信息 + + + 从不同渠道获得的OPENLINK字符串 @@ -3145,6 +3156,12 @@ 选填,部分活动、功能允许接收自定义query参数,请参阅渠道说明,默认可不填 + + + 结果对象的json字符串,各项为实验的相关信息 + + + 错误信息 @@ -3595,6 +3612,26 @@ 宽度,单位:px + + + 通知组件信息 + + + + + 组件的布局位置信息 + + + + + 组件是否显示 + + + + + 组件的名称 + + 当前占用的空间大小, 单位 KB @@ -3917,7 +3954,7 @@ - 是否开启 profile,默认开启。开启后可在接口回调的 res.profile 中查看性能调试信息。 + 是否开启 profile。iOS 和 Android 端默认开启,其他端暂不支持。开启后可在接口回调的 res.profile 中查看性能调试信息。 @@ -3943,12 +3980,6 @@ 超时时间,单位为毫秒,默认值为 60000 即一分钟。 - - - 需要基础库: `3.4.1` - 使用高性能模式,暂仅支持 Android,默认关闭。该模式下有更优的网络性能表现。 - - 错误信息 @@ -3962,7 +3993,7 @@ 需要基础库: `2.10.4` - 网络请求过程中一些调试信息,[查看详细说明](https://developers.weixin.qq.com/miniprogram/dev/framework/performance/network.html) + 网络请求过程中一些调试信息,[查看详细说明](https://developers.weixin.qq.com/miniprogram/dev/framework/performance/network.html)。目前 iOS 和 Android 端支持。 @@ -3997,12 +4028,12 @@ - DNS 域名查询完成的时间,如果使用了本地缓存(即无 DNS 查询)或持久连接,则与 fetchStart 值相等 + Local DNS 域名查询完成的时间,如果使用了本地缓存(即无 DNS 查询)或持久连接,则与 fetchStart 值相等 - DNS 域名查询开始的时间,如果使用了本地缓存(即无 DNS 查询)或持久连接,则与 fetchStart 值相等 + Local DNS 域名查询开始的时间,如果使用了本地缓存(即无 DNS 查询)或持久连接,则与 fetchStart 值相等 @@ -4020,11 +4051,29 @@ 组件准备好使用 HTTP 请求抓取资源的时间,这发生在检查本地缓存之前 + + + 需要基础库: `3.8.9` + httpDNS 完成查询的时间。仅当开启 httpDNS 功能时返回该字段。目前仅wx.request接口支持 + + + + + 需要基础库: `3.8.9` + httpDNS 开始查询的时间。仅当开启 httpDNS 功能时返回该字段。目前仅wx.request接口支持 + + 协议层根据多个请求评估当前网络的 rtt(仅供参考) + + + 需要基础库: `3.8.10` + 调用接口的时间。 + + 当前请求的IP @@ -4040,6 +4089,18 @@ 使用协议类型,有效值:http1.1, h2, quic, unknown + + + 需要基础库: `3.8.10` + 结束排队的时间。达到并行上限时才需要排队。如果未发生排队,则该字段和 queueStart 字段值相同 + + + + + 需要基础库: `3.8.10` + 开始排队的时间。达到并行上限时才需要排队。 + + 收到字节数 @@ -5540,6 +5601,26 @@ 预告状态:0可用 1取消 2已用 + + + 敏感数据对应的云 ID,开通[云开发](https://developers.weixin.qq.com/minigame/dev/wxcloud/basis/getting-started.html)的小程序才会返回,可通过云调用直接获取开放数据,详细见[云调用直接获取开放数据](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#method-cloud) + + + + + 包括敏感数据在内的完整转发信息的加密数据,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) + + + + + 错误信息 + + + + + 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) + + 剪贴板的内容 @@ -5625,6 +5706,11 @@ 使用 sha1( rawData + sessionkey ) 得到字符串,用于校验用户信息 + + + 实验参数数组,不填则获取所有实验参数 + + 需要基础库: `3.7.8` @@ -5676,6 +5762,56 @@ 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) + + + 需要获取的群用户的 groupOpenId 列表 + + + + + 所选用户的头像昵称列表 + + + + + 用户头像图片 url + + + + + 用户所在城市 + + + + + 用户所在国家 + + + + + 用户性别 + + + + + 显示 country province city 所用的语言 + + + + + 用户昵称 + + + + + 用户 openId + + + + + 用户所在省份 + + AI推理引擎版本 @@ -5811,17 +5947,6 @@ - itemSettings 只返回用户勾选过订阅面板中的“总是保持以上选择,不再询问”的订阅消息。 - - - shareTicket,详见[获取更多转发信息](#) - - - - - 需要基础库: `1.9.90` - 超时时间,单位 ms - - 封面广告组件展示状态码 @@ -6109,12 +6234,12 @@ 超时时间,单位ms - + 错误信息 - + 需要基础库: `2.24.0` errno 错误码,错误码的详细说明参考 [Errno错误码](https://developers.weixin.qq.com/minigame/dev/guide/runtime/debug/PublicErrno.html) @@ -6161,7 +6286,7 @@ - 需要传递给目标小程序的数据,目标小程序可在 `App.onLaunch`,`App.onShow` 中获取到这份数据。如果跳转的是小游戏,可以在 [wx.onShow](https://developers.weixin.qq.com/minigame/dev/api/base/app/life-cycle/wx.onShow.html)、[wx.getLaunchOptionsSync](https://developers.weixin.qq.com/minigame/dev/api/base/app/life-cycle/wx.getLaunchOptionsSync.html) 中可以获取到这份数据数据。 + 需要传递给目标小程序的数据,目标小程序可在 `App.onLaunch`,`App.onShow` 中获取到这份数据。如果跳转的是小游戏,可以在 [wx.onShow](https://developers.weixin.qq.com/minigame/dev/api/base/app/life-cycle/wx.onShow.html)、[wx.getLaunchOptionsSync](https://developers.weixin.qq.com/minigame/dev/api/base/app/life-cycle/wx.getLaunchOptionsSync.html) 中可以获取到这份数据。 @@ -6207,6 +6332,25 @@ 设置特征订阅类型,有效值有 `notification` 和 `indication` + + + + 需要提醒的用户 group_openid 列表 + + + + + 文字链标题,发送的内容将由微信拼接为:@的成员列表+“请完成:”/"请参与:"+打开小程序的文字链,如「@alex @cindy 请完成:团建报名统计」。 + + + + + 展示的动词 + 可选值: + - 'participate': 请参与; + - 'complete': 请完成; + + X 轴 @@ -6372,14 +6516,9 @@ - 'landscapeReverse': 横屏反方向,以 HOME 键在屏幕左侧为反方向; - + - 错误 - - - - - 错误调用堆栈 + 错误信息,包含堆栈 @@ -6504,6 +6643,11 @@ 当前是否处于弱网状态 + + + 全部组件的信息 + + 录屏状态 @@ -6697,6 +6841,14 @@ 变化后的窗口宽度,单位 px + + + 改变的窗口状态,可能的值为: + - 'minimize':窗口最小化 + - 'normalize':窗口恢复正常尺寸 + - 'maximize':窗口最大化 + + 需要基础库: `2.10.0` @@ -6727,6 +6879,11 @@ 视频号 id,以“sph”开头的id,可在视频号助手获取 + + + 视频号的Feed的nonceId,必填 + + 活动 id @@ -6757,6 +6914,21 @@ 视频号 id + + + 群聊类型 + 可选值: + - 1: 微信联系人单聊; + - 2: 企业微信联系人单聊; + - 3: 普通微信群聊; + - 4: 企业微信互通群聊; + + + + + 聊天室 id,不传则拉起群选择框,可以传入多聊群的 opengid 值,或者单聊群的 open_single_roomid 值 + + 企业ID @@ -7153,26 +7325,6 @@ | -10073015 | | 索要功能不可用 | - - - 敏感数据对应的云 ID,开通[云开发](https://developers.weixin.qq.com/minigame/dev/wxcloud/basis/getting-started.html)的小程序才会返回,可通过云调用直接获取开放数据,详细见[云调用直接获取开放数据](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#method-cloud) - - - - - 包括敏感数据在内的完整转发信息的加密数据,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) - - - - - 错误信息 - - - - - 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) - - 币种 @@ -7432,6 +7584,16 @@ - 'CODE_25': 一维码; + + + 最多可选人数 + + + + + 所选用户在此聊天室下的唯一标识,同一个用户在不同的聊天室下id不同 + + 蓝牙设备 id @@ -7565,6 +7727,66 @@ 是否转发到当前群。该参数只对从群工具栏打开的场景下生效,默认转发到当前群,填入false时可转发到其他会话。 + + + 转发标题 + + + + + 自定义图片路径,支持PNG及JPG,显示图片长宽比是 5:4,默认使用截图 + + + + + + 要分享的表情地址,必须为本地路径或临时路径 + + + + + + 分享的表情消息是否要带小程序入口 + + + + + 要分享的图片地址,必须为本地路径或临时路径 + + + + + + 分享的图片消息是否要带小程序入口 + + + + + 要分享的文本内容 + + + + + + 分享的表情消息是否要带小程序入口 + + + + + 要分享的视频地址,必须为本地路径或临时路径 + + + + + + 分享的图片消息是否要带小程序入口 + + + + + 缩略图路径,若留空则使用视频首帧 + + 按钮的文字数组,数组长度最大为 6 @@ -7607,6 +7829,14 @@ 键盘输入框显示的默认值 + + + 键盘类型,默认为文本类型,客户端8.0.57以上支持数字键盘 + 可选值: + - 'text': 文本; + - 'number': 数字; + + 键盘中文本的最大长度 diff --git a/Runtime/Plugins/wx-runtime.xml.meta b/Runtime/Plugins/wx-runtime.xml.meta index 993a8966e..2b34a0e68 100644 --- a/Runtime/Plugins/wx-runtime.xml.meta +++ b/Runtime/Plugins/wx-runtime.xml.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 1adef893b0fe955b2dbd96ac1c601d6e +guid: 2d49b78c46d4aa24d2f06fade54cadb4 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/WX.cs b/Runtime/WX.cs index 9261cb09f..0049afc2d 100644 --- a/Runtime/WX.cs +++ b/Runtime/WX.cs @@ -276,6 +276,16 @@ namespace WeChatWASM WXSDKManagerHandler.Instance.CreateBLEPeripheralServer(callback); } + /// + /// [wx.exitChatTool(Object object)](https://developers.weixin.qq.com/minigame/dev/api/chattool/wx.exitChatTool.html) + /// 需要基础库: `3.7.12` + /// 退出聊天工具模式 + /// + public static void ExitChatTool(ExitChatToolOption callback) + { + WXSDKManagerHandler.Instance.ExitChatTool(callback); + } + /// /// [wx.exitMiniProgram(Object object)](https://developers.weixin.qq.com/minigame/dev/api/navigate/wx.exitMiniProgram.html) /// 需要基础库: `2.17.3` @@ -511,6 +521,45 @@ namespace WeChatWASM WXSDKManagerHandler.Instance.GetChannelsLiveNoticeInfo(callback); } + /// + /// [wx.getChatToolInfo(Object object)](https://developers.weixin.qq.com/minigame/dev/api/chattool/wx.getChatToolInfo.html) + /// 需要基础库: `3.7.12` + /// 获取聊天工具模式下的群聊信息。 + /// 需要注意的是,单聊群和多聊群下返回的群唯一标识是不同的。 + /// 1. 多聊群下返回 opengid + /// 2. 单聊群下返回 open_single_roomid + /// 同时将返回用户在群(含单聊)下的唯一标识 group_openid。 + /// **示例代码** + /// ```js + /// wx.getChatToolInfo({ + /// success(res) { + /// // res + /// { + /// errMsg: 'getChatToolInfo:ok', + /// encryptedData: '', + /// iv: '' + /// } + /// }, + /// fail() { + /// } + /// }) + /// ``` + /// 敏感数据有两种获取方式,一是使用 [加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#加密数据解密算法) 。 + /// 获取得到的开放数据为以下 json 结构(其中 opengid 为当前群的唯一标识): + /// ```json + /// { + /// "opengid": "OPENGID", // 多聊群下返回的群唯一标识 + /// "open_single_roomid": "", // 单聊群下返回的群唯一标识 + /// "group_openid": "", // 用户在当前群的唯一标识 + /// "chat_type": 3, // 聊天室类型 + /// } + /// ``` + /// + public static void GetChatToolInfo(GetChatToolInfoOption callback) + { + WXSDKManagerHandler.Instance.GetChatToolInfo(callback); + } + /// /// [wx.getClipboardData(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/clipboard/wx.getClipboardData.html) /// 需要基础库: `1.1.0` @@ -641,6 +690,16 @@ namespace WeChatWASM WXSDKManagerHandler.Instance.GetGameClubData(callback); } + /// + /// [wx.getGameExptInfo(Object object)](https://developers.weixin.qq.com/minigame/dev/api/data-analysis/wx.getGameExptInfo.html) + /// 需要基础库: `3.8.8` + /// 给定实验参数数组,获取对应的实验参数值 + /// + public static void GetGameExptInfo(GetGameExptInfoOption callback) + { + WXSDKManagerHandler.Instance.GetGameExptInfo(callback); + } + /// /// [wx.getGroupEnterInfo(Object object)](https://developers.weixin.qq.com/minigame/dev/api/open-api/group/wx.getGroupEnterInfo.html) /// 需要基础库: `2.10.4` @@ -683,6 +742,16 @@ namespace WeChatWASM WXSDKManagerHandler.Instance.GetGroupEnterInfo(callback); } + /// + /// [wx.getGroupMembersInfo(Object object)](https://developers.weixin.qq.com/minigame/dev/api/open-api/data/wx.getGroupMembersInfo.html) + /// 需要基础库: `3.7.12` + /// 获取所选群成员的头像、昵称,自行在开放数据域中渲染 + /// + public static void GetGroupMembersInfo(GetGroupMembersInfoOption callback) + { + WXSDKManagerHandler.Instance.GetGroupMembersInfo(callback); + } + /// /// [wx.getInferenceEnvInfo(Object object)](https://developers.weixin.qq.com/minigame/dev/api/ai/inference/wx.getInferenceEnvInfo.html) /// 需要基础库: `2.30.1` @@ -847,27 +916,6 @@ namespace WeChatWASM WXSDKManagerHandler.Instance.GetSetting(callback); } - /// - /// [wx.getShareInfo(Object object)](https://developers.weixin.qq.com/minigame/dev/api/share/wx.getShareInfo.html) - /// 需要基础库: `1.1.0` - /// 获取转发详细信息(主要是获取群ID)。 从群聊内的小程序消息卡片打开小程序时,调用此接口才有效。从基础库 v2.17.3 开始,推荐用 [wx.getGroupEnterInfo](https://developers.weixin.qq.com/minigame/dev/api/open-api/group/wx.getGroupEnterInfo.html) 替代此接口。 - /// **示例代码** - /// 敏感数据获取方式 [加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html#加密数据解密算法) 。 - /// 获取得到的开放数据为以下 json 结构(其中 openGId 为当前群的唯一标识): - /// ```json - /// { - /// "openGId": "OPENGID" - /// } - /// ``` - /// **Tips** - /// - 如需要展示群名称,小程序可以使用 [开放数据组件](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/open-data.html) - /// - 小游戏可以通过 [`wx.getGroupInfo`](https://developers.weixin.qq.com/minigame/dev/api/open-api/data/wx.getGroupInfo.html) 接口获取群名称 - /// - public static void GetShareInfo(GetShareInfoOption callback) - { - WXSDKManagerHandler.Instance.GetShareInfo(callback); - } - /// /// [wx.getShowSplashAdStatus(Object object)](https://developers.weixin.qq.com/minigame/dev/api/ad/wx.getShowSplashAdStatus.html) /// 需要基础库: `3.7.8` @@ -1272,6 +1320,16 @@ namespace WeChatWASM WXSDKManagerHandler.Instance.NotifyBLECharacteristicValueChange(callback); } + /// + /// [wx.notifyGroupMembers(Object object)](https://developers.weixin.qq.com/minigame/dev/api/chattool/wx.notifyGroupMembers.html) + /// 需要基础库: `3.7.12` + /// 提醒用户完成任务,标题长度不超过 30 个字符,支持中英文和数字,中文算2个字符。 + /// + public static void NotifyGroupMembers(NotifyGroupMembersOption callback) + { + WXSDKManagerHandler.Instance.NotifyGroupMembers(callback); + } + /// /// [wx.openAppAuthorizeSetting(Object object)](https://developers.weixin.qq.com/minigame/dev/api/base/system/wx.openAppAuthorizeSetting.html) /// 需要基础库: `2.25.3` @@ -1383,6 +1441,19 @@ namespace WeChatWASM WXSDKManagerHandler.Instance.OpenChannelsUserProfile(callback); } + /// + /// [wx.openChatTool(Object object)](https://developers.weixin.qq.com/minigame/dev/api/chattool/wx.openChatTool.html) + /// 需要基础库: `3.7.12` + /// 进入聊天工具模式。 + /// 1. 不传入聊天室id时,微信会拉起聊天列表让用户选择,用户选择后绑定聊天室进入聊天工具模式。 + /// 2. 传入聊天室id时(群聊为opengid,单聊为open_single_roomid),会直接绑定该聊天室进入,此时必须传入对应的 chatType。 + /// 3. 聊天室类型可从 [[getGroupEnterInfo]](https://developers.weixin.qq.com/minigame/dev/api/open-api/group/wx.getGroupEnterInfo.html) 返回值中获取。 + /// + public static void OpenChatTool(OpenChatToolOption callback) + { + WXSDKManagerHandler.Instance.OpenChatTool(callback); + } + /// /// [wx.openCustomerServiceChat(Object object)](https://developers.weixin.qq.com/minigame/dev/api/open-api/service-chat/wx.openCustomerServiceChat.html) /// 需要基础库: `2.30.4` @@ -1906,6 +1977,25 @@ namespace WeChatWASM WXSDKManagerHandler.Instance.ScanCode(callback); } + /// + /// [wx.selectGroupMembers(Object object)](https://developers.weixin.qq.com/minigame/dev/api/chattool/wx.selectGroupMembers.html) + /// 需要基础库: `3.7.12` + /// 选择聊天室的成员,并返回选择成员的 group_openid。若当前为群聊,则会拉起成员选择器;若当前为单聊,则直接返回双方的 group_openid。 + /// **** + /// ```js + /// wx.selectGroupMembers({ + /// maxSelectCount: 3, + /// success(res) { + /// // res.members + /// } + /// }) + /// ``` + /// + public static void SelectGroupMembers(SelectGroupMembersOption callback) + { + WXSDKManagerHandler.Instance.SelectGroupMembers(callback); + } + /// /// [wx.setBLEMTU(Object object)](https://developers.weixin.qq.com/minigame/dev/api/device/bluetooth-ble/wx.setBLEMTU.html) /// 需要基础库: `2.11.0` @@ -2068,6 +2158,56 @@ namespace WeChatWASM WXSDKManagerHandler.Instance.SetVisualEffectOnCapture(callback); } + /// + /// [wx.shareAppMessageToGroup(Object object)](https://developers.weixin.qq.com/minigame/dev/api/chattool/wx.shareAppMessageToGroup.html) + /// 需要基础库: `3.7.12` + /// 转发小程序卡片到聊天 + /// + public static void ShareAppMessageToGroup(ShareAppMessageToGroupOption callback) + { + WXSDKManagerHandler.Instance.ShareAppMessageToGroup(callback); + } + + /// + /// [wx.shareEmojiToGroup(Object object)](https://developers.weixin.qq.com/minigame/dev/api/chattool/wx.shareEmojiToGroup.html) + /// 需要基础库: `3.7.12` + /// 转发表情到聊天 + /// + public static void ShareEmojiToGroup(ShareEmojiToGroupOption callback) + { + WXSDKManagerHandler.Instance.ShareEmojiToGroup(callback); + } + + /// + /// [wx.shareImageToGroup(Object object)](https://developers.weixin.qq.com/minigame/dev/api/chattool/wx.shareImageToGroup.html) + /// 需要基础库: `3.7.12` + /// 转发图片到聊天 + /// + public static void ShareImageToGroup(ShareImageToGroupOption callback) + { + WXSDKManagerHandler.Instance.ShareImageToGroup(callback); + } + + /// + /// [wx.shareTextToGroup(Object object)](https://developers.weixin.qq.com/minigame/dev/api/chattool/wx.shareTextToGroup.html) + /// 需要基础库: `3.7.12` + /// 转发文本到聊天 + /// + public static void ShareTextToGroup(ShareTextToGroupOption callback) + { + WXSDKManagerHandler.Instance.ShareTextToGroup(callback); + } + + /// + /// [wx.shareVideoToGroup(Object object)](https://developers.weixin.qq.com/minigame/dev/api/chattool/wx.shareVideoToGroup.html) + /// 需要基础库: `3.7.12` + /// 转发视频到聊天 + /// + public static void ShareVideoToGroup(ShareVideoToGroupOption callback) + { + WXSDKManagerHandler.Instance.ShareVideoToGroup(callback); + } + /// /// [wx.showActionSheet(Object object)](https://developers.weixin.qq.com/minigame/dev/api/ui/interaction/wx.showActionSheet.html) /// 显示操作菜单 @@ -2578,6 +2718,16 @@ namespace WeChatWASM WXSDKManagerHandler.Instance.ExitPointerLock(); } + /// + /// [wx.isChatTool()](https://developers.weixin.qq.com/minigame/dev/api/chattool/wx.isChatTool.html) + /// 需要基础库: `3.7.12` + /// 是否处于聊天工具模式 + /// + public static void IsChatTool() + { + WXSDKManagerHandler.Instance.IsChatTool(); + } + /// /// [wx.removeStorageSync(string key)](https://developers.weixin.qq.com/minigame/dev/api/storage/wx.removeStorageSync.html) /// [wx.removeStorage](https://developers.weixin.qq.com/minigame/dev/api/storage/wx.removeStorage.html) 的同步版本 @@ -2667,23 +2817,6 @@ namespace WeChatWASM WXSDKManagerHandler.Instance.RevokeBufferURL(url); } - /// - /// [wx.setStorageSync(string key, any data)](https://developers.weixin.qq.com/minigame/dev/api/storage/wx.setStorageSync.html) - /// 将数据存储在本地缓存中指定的 key 中。会覆盖掉原来该 key 对应的内容。除非用户主动删除或因存储空间原因被系统清理,否则数据都一直可用。单个 key 允许存储的最大数据长度为 1MB,所有数据存储上限为 10MB。 - /// **注意** - /// storage 应只用来进行数据的持久化存储,不应用于运行时的数据传递或全局状态管理。启动过程中过多的同步读写存储,会显著影响启动耗时。 - /// **示例代码** - /// ```js - /// try { - /// wx.setStorageSync('key', 'value') - /// } catch (e) { } - /// ``` - /// - public static void SetStorageSync(string key, T data) - { - WXSDKManagerHandler.Instance.SetStorageSync(key, data); - } - /// /// [wx.shareAppMessage(Object object)](https://developers.weixin.qq.com/minigame/dev/api/share/wx.shareAppMessage.html) /// 主动拉起转发,进入选择通讯录界面。 @@ -2992,12 +3125,12 @@ namespace WeChatWASM /// [wx.onError(function listener)](https://developers.weixin.qq.com/minigame/dev/api/base/app/app-event/wx.onError.html) /// 监听全局错误事件 /// - public static void OnError(Action error) + public static void OnError(Action error) { WXSDKManagerHandler.Instance.OnError(error); } - public static void OffError(Action error) + public static void OffError(Action error) { WXSDKManagerHandler.Instance.OffError(error); } @@ -3274,6 +3407,28 @@ namespace WeChatWASM WXSDKManagerHandler.Instance.OffNetworkWeakChange(result); } + /// + /// [wx.onOfficialComponentsInfoChange(function listener)](https://developers.weixin.qq.com/minigame/dev/api/ui/menu/wx.onOfficialComponentsInfoChange.html) + /// 需要基础库: `3.7.12` + /// 监听官方组件信息变化事件 + /// **示例代码** + /// ```js + /// const callback = res => console.log('officialComponentsInfoChange', res) + /// wx.onOfficialComponentsInfoChange(callback) + /// // 取消监听 + /// wx.offOfficialComponentsInfoChange(callback) + /// ``` + /// + public static void OnOfficialComponentsInfoChange(Action result) + { + WXSDKManagerHandler.Instance.OnOfficialComponentsInfoChange(result); + } + + public static void OffOfficialComponentsInfoChange(Action result) + { + WXSDKManagerHandler.Instance.OffOfficialComponentsInfoChange(result); + } + /// /// [wx.onScreenRecordingStateChanged(function listener)](https://developers.weixin.qq.com/minigame/dev/api/device/screen/wx.onScreenRecordingStateChanged.html) /// 需要基础库: `3.1.4` @@ -3455,10 +3610,25 @@ namespace WeChatWASM WXSDKManagerHandler.Instance.OffWindowResize(result); } + /// + /// [wx.onWindowStateChange(function listener)](https://developers.weixin.qq.com/minigame/dev/api/ui/window/wx.onWindowStateChange.html) + /// 需要基础库: `3.8.8` + /// 监听小程序窗口状态变化事件。仅适用于 PC 平台 + /// + public static void OnWindowStateChange(Action result) + { + WXSDKManagerHandler.Instance.OnWindowStateChange(result); + } + + public static void OffWindowStateChange(Action result) + { + WXSDKManagerHandler.Instance.OffWindowStateChange(result); + } + /// /// [wx.onAddToFavorites(function listener)](https://developers.weixin.qq.com/minigame/dev/api/share/wx.onAddToFavorites.html) /// 需要基础库: `2.10.3` - /// 监听用户点击菜单「收藏」按钮时触发的事件(安卓7.0.15起支持,iOS 暂不支持) + /// 监听用户点击菜单「收藏」按钮时触发的事件 /// public static void OnAddToFavorites(Action> callback) { @@ -3769,6 +3939,30 @@ namespace WeChatWASM return WXSDKManagerHandler.GetMenuButtonBoundingClientRect(); } + /// + /// [Object wx.getOfficialComponentsInfo()](https://developers.weixin.qq.com/minigame/dev/api/ui/menu/wx.getOfficialComponentsInfo.html) + /// 需要基础库: `3.7.12` + /// 获取所有官方组件的相关信息 + /// **示例代码** + /// ```js + /// const componentsInfo = wx.getOfficialComponentsInfo(); + /// const { notificationComponentInfo } = componentsInfo; + /// if (notificationComponentInfo.isShow) { + /// console.log(notificationComponentInfo.boundingClientRect.width); + /// console.log(notificationComponentInfo.boundingClientRect.height); + /// console.log(notificationComponentInfo.boundingClientRect.top); + /// console.log(notificationComponentInfo.boundingClientRect.left); + /// console.log(notificationComponentInfo.boundingClientRect.bottom); + /// console.log(notificationComponentInfo.boundingClientRect.right); + /// } + /// ``` + /// + /// + public static OfficialComponentsInfo GetOfficialComponentsInfo() + { + return WXSDKManagerHandler.GetOfficialComponentsInfo(); + } + /// /// [Object wx.getStorageInfoSync()](https://developers.weixin.qq.com/minigame/dev/api/storage/wx.getStorageInfoSync.html) /// [wx.getStorageInfo](https://developers.weixin.qq.com/minigame/dev/api/storage/wx.getStorageInfo.html) 的同步版本 diff --git a/Runtime/WXBase.cs b/Runtime/WXBase.cs index 5a74542d4..fed9ae2b8 100644 --- a/Runtime/WXBase.cs +++ b/Runtime/WXBase.cs @@ -766,6 +766,16 @@ namespace WeChatWASM return WXSDKManagerHandler.Instance.GetCachePath(url); } + /// + /// 临时修复安卓在主线程繁忙时,异步读缓存耗时高,但需关注同步读文件可能导致掉帧 + /// 仅在有需要的情况下主动开启,需要同步读的场景完成后再主动关闭 + /// + /// + public static void SetSyncReadCacheEnabled(bool enabled) + { + WXSDKManagerHandler.Instance.SetSyncReadCacheEnabled(enabled); + } + #endregion /// @@ -1137,6 +1147,7 @@ namespace WeChatWASM } #endregion +#region PageManager /// /// [[PageManager](https://developers.weixin.qq.com/minigame/dev/api/open-api/openlink/PageManager.html) wx.createPageManager()](https://developers.weixin.qq.com/minigame/dev/api/open-api/openlink/wx.createPageManager.html) /// 需要基础库: `3.6.7` @@ -1162,6 +1173,22 @@ namespace WeChatWASM { return WXSDKManagerHandler.Instance.CreatePageManager(); } +#endregion + +#region 上报 + /// + public static WXMiniReportManager GetMiniReportManager(GetMiniReportManagerParam param) + { + return WXSDKManagerHandler.Instance.GetMiniReportManager(param); + } +#endregion + +#region 社交特色能力 + public static WXRankManager GetRankManager() { + return WXSDKManagerHandler.Instance.GetRankManager(); + } } } +#endregion + #endif diff --git a/Runtime/WXTouchInputOverride.cs b/Runtime/WXTouchInputOverride.cs index dc7ca2b6d..82a963b51 100644 --- a/Runtime/WXTouchInputOverride.cs +++ b/Runtime/WXTouchInputOverride.cs @@ -149,7 +149,9 @@ public class WXTouchInputOverride : BaseInput Text text = selectedObject.GetComponent(); if (text != null) { -#if PLATFORM_WEIXINMINIGAME +#if PLATFORM_PLAYABLEADS + PlayableAdsInput.mobileKeyboardSupport = true; +#elif PLATFORM_WEIXINMINIGAME WeixinMiniGameInput.mobileKeyboardSupport = true; #elif PLATFORM_WEBGL #if UNITY_2022_1_OR_NEWER @@ -159,7 +161,9 @@ public class WXTouchInputOverride : BaseInput } else { -#if PLATFORM_WEIXINMINIGAME +#if PLATFORM_PLAYABLEADS + PlayableAdsInput.mobileKeyboardSupport = false; +#elif PLATFORM_WEIXINMINIGAME WeixinMiniGameInput.mobileKeyboardSupport = false; #elif PLATFORM_WEBGL #if UNITY_2022_1_OR_NEWER diff --git a/Runtime/playable-default/check-version.js.meta b/Runtime/playable-default/check-version.js.meta index a94947786..4ec7f62b8 100644 --- a/Runtime/playable-default/check-version.js.meta +++ b/Runtime/playable-default/check-version.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 75ef85528de9cf32347c924331a4b281 + guid: 5a3338f5854d3b064e68e78996fd755c DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/data-package.meta b/Runtime/playable-default/data-package.meta index 8049b2612..ab27bbc80 100644 --- a/Runtime/playable-default/data-package.meta +++ b/Runtime/playable-default/data-package.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c233f641f99d4f78c505a46b3e10268a +guid: d8ed7083447b6b9c67876096cbc37c6a folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/playable-default/data-package/game.js.meta b/Runtime/playable-default/data-package/game.js.meta index ed8ad4a69..a913335a7 100644 --- a/Runtime/playable-default/data-package/game.js.meta +++ b/Runtime/playable-default/data-package/game.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 9c8d7e78ba8ed93f81612e8cf4157812 + guid: 3dec691cf854c9ba33558037b85674df DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/events.js.meta b/Runtime/playable-default/events.js.meta index ac16f6220..e82e07a84 100644 --- a/Runtime/playable-default/events.js.meta +++ b/Runtime/playable-default/events.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 6381bef0b1cb25ca0814ee9ec3c33584 + guid: 32c71ecc082161c159930b1b3bf848a1 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/game.js.meta b/Runtime/playable-default/game.js.meta index 91cb872e0..da57fbbd2 100644 --- a/Runtime/playable-default/game.js.meta +++ b/Runtime/playable-default/game.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 3a706d427ddc6f17a686d00164596b21 + guid: 6c2a4db476f5604545571ef2c3c375b7 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/game.json.meta b/Runtime/playable-default/game.json.meta index a0a96c788..309d2ccda 100644 --- a/Runtime/playable-default/game.json.meta +++ b/Runtime/playable-default/game.json.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 3b7afa312f37129c5f0da72ca5085ed2 + guid: add9c0e40a56f3968335f0f3730d3399 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/playable-fix.js.meta b/Runtime/playable-default/playable-fix.js.meta index da2bc9ba4..1cdb4aea7 100644 --- a/Runtime/playable-default/playable-fix.js.meta +++ b/Runtime/playable-default/playable-fix.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 38ef877315e858a891e38a8504d14444 + guid: f160ffbf637126094e69832be9c1fb9d DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/plugin-config.js.meta b/Runtime/playable-default/plugin-config.js.meta index 28faea734..5ce2de3fa 100644 --- a/Runtime/playable-default/plugin-config.js.meta +++ b/Runtime/playable-default/plugin-config.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: db19f71416cd53e87a23c48b14b8558e + guid: 4788c155ccc54f28b5a98bf65226a1a0 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/plugins.meta b/Runtime/playable-default/plugins.meta index 69255cea6..cec9d93aa 100644 --- a/Runtime/playable-default/plugins.meta +++ b/Runtime/playable-default/plugins.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 844e9fbfa7180d47a44d3655a47bfa6a +guid: db0431f33b815d4e5d9f630df15ef5eb folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/playable-default/plugins/check-update.js.meta b/Runtime/playable-default/plugins/check-update.js.meta index 4902cf0db..ab792aa6a 100644 --- a/Runtime/playable-default/plugins/check-update.js.meta +++ b/Runtime/playable-default/plugins/check-update.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 7bd7e7175cbf02cf19c630e5dde4919c + guid: 2ed7f6d1b98c06d65f03e3e441b16510 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/plugins/screen-adapter.js.meta b/Runtime/playable-default/plugins/screen-adapter.js.meta index 2857460b7..f1dc0c918 100644 --- a/Runtime/playable-default/plugins/screen-adapter.js.meta +++ b/Runtime/playable-default/plugins/screen-adapter.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 89a34b810a1a142d563099e15e414093 + guid: 11e564cd1dd6fe38b8a3e1ed1179dc80 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/project.config.json.meta b/Runtime/playable-default/project.config.json.meta index 5400e1a35..cd8caf0aa 100644 --- a/Runtime/playable-default/project.config.json.meta +++ b/Runtime/playable-default/project.config.json.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 306d6397d3c633cd3388633bf4d36a76 + guid: 87f156027172b36f2789baeacd58b28e DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/texture-config.js.meta b/Runtime/playable-default/texture-config.js.meta index a2134bcad..51ab237b7 100644 --- a/Runtime/playable-default/texture-config.js.meta +++ b/Runtime/playable-default/texture-config.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: fafe80396291e3992588aa528e0e92a1 + guid: fedd1394787318d4f7205ef06d59fdf9 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-namespace.js.meta b/Runtime/playable-default/unity-namespace.js.meta index b806295b1..c206b78eb 100644 --- a/Runtime/playable-default/unity-namespace.js.meta +++ b/Runtime/playable-default/unity-namespace.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 371613b26b33189b2dbc0e63af9c2aa8 + guid: 0e492926f033c6848a13ff998528e660 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-playable-plugin.meta b/Runtime/playable-default/unity-playable-plugin.meta index e44b788df..263a138b0 100644 --- a/Runtime/playable-default/unity-playable-plugin.meta +++ b/Runtime/playable-default/unity-playable-plugin.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 2056d2dadba4cdc21c89b03008d5754a +guid: 27c3cbc2a7be6ad981f6ab2e7ef34000 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/playable-default/unity-playable-plugin/index.js.meta b/Runtime/playable-default/unity-playable-plugin/index.js.meta index 9b1d772be..3b7a041a7 100644 --- a/Runtime/playable-default/unity-playable-plugin/index.js.meta +++ b/Runtime/playable-default/unity-playable-plugin/index.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 02dffa55081d6f775f17621b7aca54de + guid: ef42e68b8678762e856c1c584090806a DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk.meta b/Runtime/playable-default/unity-sdk.meta index 7f67bb60a..ce6627478 100644 --- a/Runtime/playable-default/unity-sdk.meta +++ b/Runtime/playable-default/unity-sdk.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 2e17b41cccc3aab50c531f3f846777e5 +guid: d84236a5895ade2ae8fa098822cf0634 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/playable-default/unity-sdk/audio.meta b/Runtime/playable-default/unity-sdk/audio.meta index 9638d0364..91d2efe12 100644 --- a/Runtime/playable-default/unity-sdk/audio.meta +++ b/Runtime/playable-default/unity-sdk/audio.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d2d2ffeeb21555008dc418d316063a90 +guid: ad45f8124bdca9bae00194edd4ccf5a7 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/playable-default/unity-sdk/audio/common.js.meta b/Runtime/playable-default/unity-sdk/audio/common.js.meta index 93c8ae594..7f09d7b75 100644 --- a/Runtime/playable-default/unity-sdk/audio/common.js.meta +++ b/Runtime/playable-default/unity-sdk/audio/common.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 725da8ab5cb786687eb3672109cd7ad0 + guid: 17e3f96e36691672697b3a41f4fbb061 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/audio/const.js.meta b/Runtime/playable-default/unity-sdk/audio/const.js.meta index cb7081b0b..ad70f981c 100644 --- a/Runtime/playable-default/unity-sdk/audio/const.js.meta +++ b/Runtime/playable-default/unity-sdk/audio/const.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 16aea3ab47cc15ca64c9be6db6dfda11 + guid: 26c6a7230a2aac7e69f7e77b5712863a DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/audio/index.js.meta b/Runtime/playable-default/unity-sdk/audio/index.js.meta index f3d2dd890..245283667 100644 --- a/Runtime/playable-default/unity-sdk/audio/index.js.meta +++ b/Runtime/playable-default/unity-sdk/audio/index.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 5102a7a140da8b309dc8cfeba79cb238 + guid: 07f77dc511b4658520c204143e5d4187 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/audio/inner-audio.js.meta b/Runtime/playable-default/unity-sdk/audio/inner-audio.js.meta index 72baf08c4..bd843f7c3 100644 --- a/Runtime/playable-default/unity-sdk/audio/inner-audio.js.meta +++ b/Runtime/playable-default/unity-sdk/audio/inner-audio.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 4d3cd0899ccf7f7a8a7784a8ef0f493e + guid: 3e47a0a55de2da6ffc3612c87550c443 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/audio/store.js.meta b/Runtime/playable-default/unity-sdk/audio/store.js.meta index c2d0f5aac..bd57f351d 100644 --- a/Runtime/playable-default/unity-sdk/audio/store.js.meta +++ b/Runtime/playable-default/unity-sdk/audio/store.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: fcbd0e472755678cb73ce15c59456b49 + guid: 6318d25b421354f4be451653771e54d7 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/audio/unity-audio.js b/Runtime/playable-default/unity-sdk/audio/unity-audio.js index bf675abc0..3dcb2fd5c 100644 --- a/Runtime/playable-default/unity-sdk/audio/unity-audio.js +++ b/Runtime/playable-default/unity-sdk/audio/unity-audio.js @@ -1018,6 +1018,9 @@ export default { if (WEBAudio.audioWebSupport === 0 || WEBAudio.audioWebEnabled === 0) { return; } + if (WEBAudio.audioContext && WEBAudio.audioContext.state !== 'suspended') { + return; + } resumeWebAudio(); }, _JS_Sound_Set3D(channelInstance, threeD) { diff --git a/Runtime/playable-default/unity-sdk/audio/unity-audio.js.meta b/Runtime/playable-default/unity-sdk/audio/unity-audio.js.meta index cac03cd40..9fa463777 100644 --- a/Runtime/playable-default/unity-sdk/audio/unity-audio.js.meta +++ b/Runtime/playable-default/unity-sdk/audio/unity-audio.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 96fb3e98d187bbbc7a6e54e620eb1183 + guid: cf3f8cbfc8679f7e11ab715ee0dc09a7 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/audio/utils.js.meta b/Runtime/playable-default/unity-sdk/audio/utils.js.meta index 1308197d5..5cfcf45d7 100644 --- a/Runtime/playable-default/unity-sdk/audio/utils.js.meta +++ b/Runtime/playable-default/unity-sdk/audio/utils.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 46d32a16e64018567a02b90541549025 + guid: 1fb37672ae8f9c3ad4ef882882da5ffa DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/canvas-context.js.meta b/Runtime/playable-default/unity-sdk/canvas-context.js.meta index a2e18a80c..3da1fc430 100644 --- a/Runtime/playable-default/unity-sdk/canvas-context.js.meta +++ b/Runtime/playable-default/unity-sdk/canvas-context.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 917aa8b5c3fa53d8a5d2f345d09f200d + guid: 0e426bff0838c78311a80260fd1b3b5a DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/canvas.js.meta b/Runtime/playable-default/unity-sdk/canvas.js.meta index 3e1b276af..179063c40 100644 --- a/Runtime/playable-default/unity-sdk/canvas.js.meta +++ b/Runtime/playable-default/unity-sdk/canvas.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 87f055f5dccc138fd6dcef872e67bf0c + guid: 4c4622bc9850288224ef127b711a484b DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/conf.js.meta b/Runtime/playable-default/unity-sdk/conf.js.meta index 5fb99243f..1c6caae7c 100644 --- a/Runtime/playable-default/unity-sdk/conf.js.meta +++ b/Runtime/playable-default/unity-sdk/conf.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 3ce278d439a9839fc4c3b4502ba8a01e + guid: 1e684b95e2f4aff4819a2286ed91bebd DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/file-info.js.meta b/Runtime/playable-default/unity-sdk/file-info.js.meta index fe28d2543..940a0cd3a 100644 --- a/Runtime/playable-default/unity-sdk/file-info.js.meta +++ b/Runtime/playable-default/unity-sdk/file-info.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 702973570969846d4ed4407aa01cf046 + guid: 7ad6f6edca48c28a87cdaa9422b37eb6 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/fix.js.meta b/Runtime/playable-default/unity-sdk/fix.js.meta index 7b7f7f9a1..524708d52 100644 --- a/Runtime/playable-default/unity-sdk/fix.js.meta +++ b/Runtime/playable-default/unity-sdk/fix.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: d7ea1e611371f45ccd52c676ad877e8d + guid: f72a805b5b6263407a2756a3260cf27a DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/fs.js.meta b/Runtime/playable-default/unity-sdk/fs.js.meta index 7d54553c0..ebf57066b 100644 --- a/Runtime/playable-default/unity-sdk/fs.js.meta +++ b/Runtime/playable-default/unity-sdk/fs.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 5893dde60ed16d4c92c40263d3d9570d + guid: ea1d35e586eaf436758a1cbcd6bc1688 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/index.js.meta b/Runtime/playable-default/unity-sdk/index.js.meta index 42035232c..f42a1a06a 100644 --- a/Runtime/playable-default/unity-sdk/index.js.meta +++ b/Runtime/playable-default/unity-sdk/index.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: a60e3e46baf7aeca26f359e5fb988f5b + guid: 91424ccb35d8c0d9277c41d24a414fa8 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/logger.js.meta b/Runtime/playable-default/unity-sdk/logger.js.meta index 3cb58828d..68b0d5126 100644 --- a/Runtime/playable-default/unity-sdk/logger.js.meta +++ b/Runtime/playable-default/unity-sdk/logger.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: cbc6c6f103b6ac0ed8153d44a5811cf8 + guid: cc24bacc359092bff5c00fc9738d2696 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/mobileKeyboard.meta b/Runtime/playable-default/unity-sdk/mobileKeyboard.meta index 37d692bf8..cebd12cad 100644 --- a/Runtime/playable-default/unity-sdk/mobileKeyboard.meta +++ b/Runtime/playable-default/unity-sdk/mobileKeyboard.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3dcf6ae343c0fa275e0aafef55ee43a1 +guid: 5acf936904bb171d102b09c97e6cd94a folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/playable-default/unity-sdk/mobileKeyboard/index.js.meta b/Runtime/playable-default/unity-sdk/mobileKeyboard/index.js.meta index 5fc0a4327..b3c1bf17b 100644 --- a/Runtime/playable-default/unity-sdk/mobileKeyboard/index.js.meta +++ b/Runtime/playable-default/unity-sdk/mobileKeyboard/index.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: c27d44cb16a69da700f08574dea9d4ed + guid: 3365926735112998f6ec35eb00d6117c DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/module-helper.js.meta b/Runtime/playable-default/unity-sdk/module-helper.js.meta index 52220af41..6c069714c 100644 --- a/Runtime/playable-default/unity-sdk/module-helper.js.meta +++ b/Runtime/playable-default/unity-sdk/module-helper.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 1783e806582197eaaf07db70f00e7ee4 + guid: d92de167696b3b2f36ebb158938cc380 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/recorder.js.meta b/Runtime/playable-default/unity-sdk/recorder.js.meta index dc44811af..d5bca8c89 100644 --- a/Runtime/playable-default/unity-sdk/recorder.js.meta +++ b/Runtime/playable-default/unity-sdk/recorder.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: ccf0ee7ff1c26648ad79f9de2c7d7ff1 + guid: 35b15ee0c1b33ac5a3b7fb041c4837d1 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/resType.js b/Runtime/playable-default/unity-sdk/resType.js index 1cc38b161..a4a98d884 100644 --- a/Runtime/playable-default/unity-sdk/resType.js +++ b/Runtime/playable-default/unity-sdk/resType.js @@ -93,6 +93,14 @@ export const ResType = { top: 'number', width: 'number', }, + OfficialComponentsInfo: { + notificationComponentInfo: 'OfficialComponentInfo', + }, + OfficialComponentInfo: { + boundingClientRect: 'ClientRect', + isVisible: 'bool', + name: 'string', + }, GetStorageInfoSyncOption: { currentSize: 'number', keys: 'string[]', @@ -180,10 +188,15 @@ export const ResType = { downstreamThroughputKbpsEstimate: 'number', estimate_nettype: 'number', fetchStart: 'number', + httpDNSDomainLookUpEnd: 'number', + httpDNSDomainLookUpStart: 'number', httpRttEstimate: 'number', + invokeStart: 'number', peerIP: 'string', port: 'number', protocol: 'string', + queueEnd: 'number', + queueStart: 'number', receivedBytedCount: 'number', redirectEnd: 'number', redirectStart: 'number', @@ -518,6 +531,12 @@ export const ResType = { status: 'number', errMsg: 'string', }, + GetChatToolInfoSuccessCallbackResult: { + cloudID: 'string', + encryptedData: 'string', + errMsg: 'string', + iv: 'string', + }, GetClipboardDataSuccessCallbackOption: { data: 'string', errMsg: 'string', @@ -555,6 +574,10 @@ export const ResType = { signature: 'string', errMsg: 'string', }, + GetGameExptInfoSuccessCallbackResult: { + list: 'object', + errMsg: 'string', + }, GetGroupEnterInfoError: { errMsg: 'string', errCode: 'number', @@ -565,6 +588,20 @@ export const ResType = { errMsg: 'string', iv: 'string', }, + GetGroupMembersInfoSuccessCallbackResult: { + membersInfo: 'ResultOpenDataContextUserInfo[]', + errMsg: 'string', + }, + ResultOpenDataContextUserInfo: { + avatarUrl: 'string', + city: 'string', + country: 'string', + gender: 'number', + language: 'string', + nickName: 'string', + openId: 'string', + province: 'string', + }, GetInferenceEnvInfoSuccessCallbackResult: { ver: 'string', errMsg: 'string', @@ -667,7 +704,7 @@ export const ResType = { errMsg: 'string', openIdList: 'string[]', }, - RequestFailCallbackErr: { + LoginFailCallbackErr: { errMsg: 'string', errno: 'number', }, @@ -736,9 +773,8 @@ export const ResType = { OnDeviceOrientationChangeListenerResult: { value: 'string', }, - Error: { + ListenerError: { message: 'string', - stack: 'string', }, OnGamepadConnectedListenerResult: { gamepad: 'string', @@ -784,6 +820,9 @@ export const ResType = { networkType: 'string', weakNet: 'bool', }, + OnOfficialComponentsInfoChangeListenerResult: { + OfficialComponentsInfo: 'OfficialComponentsInfo', + }, OnScreenRecordingStateChangedListenerResult: { state: 'string', }, @@ -846,6 +885,9 @@ export const ResType = { windowHeight: 'number', windowWidth: 'number', }, + OnWindowStateChangeListenerResult: { + state: 'string', + }, OpenCardRequestInfo: { cardId: 'string', code: 'string', @@ -889,12 +931,6 @@ export const ResType = { errMsg: 'string', errCode: 'number', }, - RequestMidasFriendPaymentSuccessCallbackResult: { - cloudID: 'string', - encryptedData: 'string', - errMsg: 'string', - iv: 'string', - }, MidasPaymentError: { errMsg: 'string', errCode: 'number', @@ -940,6 +976,10 @@ export const ResType = { scanType: 'string', errMsg: 'string', }, + GroupMemberInfo: { + members: 'string[]', + errMsg: 'string', + }, SetBLEMTUFailCallbackResult: { mtu: 'number', }, diff --git a/Runtime/playable-default/unity-sdk/resType.js.meta b/Runtime/playable-default/unity-sdk/resType.js.meta index 9379c2524..67678e0e4 100644 --- a/Runtime/playable-default/unity-sdk/resType.js.meta +++ b/Runtime/playable-default/unity-sdk/resType.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 3c2f92a35946993b6a650071a3367699 + guid: c76a7ce5f0c3f9bed7605e8077f0153a DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/resTypeOther.js b/Runtime/playable-default/unity-sdk/resTypeOther.js index 9ca8b5a42..ead21e383 100644 --- a/Runtime/playable-default/unity-sdk/resTypeOther.js +++ b/Runtime/playable-default/unity-sdk/resTypeOther.js @@ -86,4 +86,12 @@ export const ResTypeOther = { status: 'number', errMsg: 'string', }, + LoadOption: { + openlink: 'string', + query: 'object', + }, + ShowOption: { + openlink: 'string', + query: 'object', + }, }; diff --git a/Runtime/playable-default/unity-sdk/resTypeOther.js.meta b/Runtime/playable-default/unity-sdk/resTypeOther.js.meta index f01433274..fe41b0dfe 100644 --- a/Runtime/playable-default/unity-sdk/resTypeOther.js.meta +++ b/Runtime/playable-default/unity-sdk/resTypeOther.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 258cafce20c4fedc1f00322b31e35b54 + guid: f18dd9a077be662539b897febcd489ca DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/response.js.meta b/Runtime/playable-default/unity-sdk/response.js.meta index 140c58ea5..2b2fbbf0b 100644 --- a/Runtime/playable-default/unity-sdk/response.js.meta +++ b/Runtime/playable-default/unity-sdk/response.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: d2b3a6bb22a417c4319dd9c53c1e3bc4 + guid: a5df34a6ac704a166406a24bffc3fa00 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/sdk.js b/Runtime/playable-default/unity-sdk/sdk.js index 0c1957ed6..9046d24b0 100644 --- a/Runtime/playable-default/unity-sdk/sdk.js +++ b/Runtime/playable-default/unity-sdk/sdk.js @@ -27,10 +27,12 @@ function WX_OneWayNoFunction(functionName, ...params) { } -const onlyReadyResponse = [ +const onlyReadResponse = [ 'getSystemSetting', 'getAppAuthorizeSetting', ]; + +const needParseJson = ['WXMiniReportManagerReport']; // eslint-disable-next-line @typescript-eslint/naming-convention function WX_SyncFunction(functionName, ...params) { return wx[functionName.replace(/^\w/, (a) => a.toLowerCase())](...params); @@ -72,6 +74,10 @@ export default { ...config, success(res) { formatResponse(successType, res); + + if (lowerFunctionName === 'getGameExptInfo') { + res.list = JSON.stringify(res.list); + } moduleHelper.send(`${functionName}Callback`, JSON.stringify({ callbackId, type: 'success', res: JSON.stringify(res), })); @@ -234,7 +240,7 @@ export default { }, WX_SyncFunction_t(functionName, returnType) { const res = WX_SyncFunction(functionName); - if (onlyReadyResponse.includes(functionName.replace(/^\w/, (a) => a.toLowerCase()))) { + if (onlyReadResponse.includes(functionName.replace(/^\w/, (a) => a.toLowerCase()))) { formatResponse(returnType, JSON.parse(JSON.stringify(res))); return JSON.stringify(res); } @@ -355,7 +361,8 @@ export default { } ClassOnEventLists[className + functionName][id + eventName].push(callback); // WXVideoDecoder OnEvent 不规范 特殊处理 - if (className === 'WXVideoDecoder') { + // update: 2025.9.27: 严重怀疑之前 WXPageManager 压根没有跑通过事件监听,跑到下面去了 + if (className === 'WXVideoDecoder' || className === 'WXPageManager') { obj[functionName.replace(/^\w/, (a) => a.toLowerCase())](eventName, callback); } else { @@ -378,7 +385,8 @@ export default { } ClassOnEventLists[className + functionName][id + eventName].forEach((v) => { - if (className === 'WXVideoDecoder') { + + if (className === 'WXVideoDecoder' || className === 'WXPageManager') { obj[functionName.replace(/^\w/, (a) => a.toLowerCase())](eventName, v); } else { @@ -391,6 +399,10 @@ export default { WX_ClassOneWayNoFunction(className, functionName, id); }, WX_ClassOneWayNoFunction_vs(className, functionName, id, param1) { + if (needParseJson.includes(className + functionName)) { + // eslint-disable-next-line no-param-reassign + param1 = JSON.parse(param1); + } WX_ClassOneWayNoFunction(className, functionName, id, param1); }, WX_ClassOneWayNoFunction_t(className, functionName, returnType, id) { diff --git a/Runtime/playable-default/unity-sdk/sdk.js.meta b/Runtime/playable-default/unity-sdk/sdk.js.meta index f66714d0c..318b94bd2 100644 --- a/Runtime/playable-default/unity-sdk/sdk.js.meta +++ b/Runtime/playable-default/unity-sdk/sdk.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 4b4d8cf78fb8f0deae740c1455980c05 + guid: 0ad86e734ca1366d9aa75d71a14c5ca1 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/special-callbacks.js.meta b/Runtime/playable-default/unity-sdk/special-callbacks.js.meta index 16a4297d4..daec8b2d7 100644 --- a/Runtime/playable-default/unity-sdk/special-callbacks.js.meta +++ b/Runtime/playable-default/unity-sdk/special-callbacks.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 1cdeff3721d88cf441e2496f5985d8a6 + guid: 18e51334b191d8d43bfdbed71b57c1cd DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/texture.js.meta b/Runtime/playable-default/unity-sdk/texture.js.meta index 367fb9eb9..824461fc0 100644 --- a/Runtime/playable-default/unity-sdk/texture.js.meta +++ b/Runtime/playable-default/unity-sdk/texture.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: ebd17001e77737e9af70face72bdb798 + guid: 38e497940f8f4650424f52109c9fc328 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/touch.meta b/Runtime/playable-default/unity-sdk/touch.meta index 1b36beeba..d02ed1c8e 100644 --- a/Runtime/playable-default/unity-sdk/touch.meta +++ b/Runtime/playable-default/unity-sdk/touch.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 1d890fc09a8d4b11c345054b5646d07c +guid: 4d931df8c0f38246d33fa774cc3c479f folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/playable-default/unity-sdk/touch/index.js.meta b/Runtime/playable-default/unity-sdk/touch/index.js.meta index 4163d1736..94e478e4e 100644 --- a/Runtime/playable-default/unity-sdk/touch/index.js.meta +++ b/Runtime/playable-default/unity-sdk/touch/index.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 879e7dcbaa62cc8b6ab0ca01df6a24bf + guid: 163f5af7c9c1931c2a99949e2c8f0f34 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/util.js.meta b/Runtime/playable-default/unity-sdk/util.js.meta index 5620d2de0..59fc47ed8 100644 --- a/Runtime/playable-default/unity-sdk/util.js.meta +++ b/Runtime/playable-default/unity-sdk/util.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: c82a8346461886817b5d0f44ed863978 + guid: 0ec945af16a6f9124651e7eaa4cab678 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/utils.js.meta b/Runtime/playable-default/unity-sdk/utils.js.meta index 608afd2a3..41589279c 100644 --- a/Runtime/playable-default/unity-sdk/utils.js.meta +++ b/Runtime/playable-default/unity-sdk/utils.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 1ce68770a3cce9a2f7a0f2296c8dc6b5 + guid: f67873756d313bf6289cdc3ed1741ae2 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/video.js b/Runtime/playable-default/unity-sdk/video.js index 56bc70f05..53706d8cc 100644 --- a/Runtime/playable-default/unity-sdk/video.js +++ b/Runtime/playable-default/unity-sdk/video.js @@ -18,36 +18,27 @@ export default { if (!obj) { return; } - if (key === 'x' || key === 'y' || key === 'width' || key === 'height' || key === 'playbackRate' || key === 'initialTime') { + if (key === 'x' || key === 'y' || key === 'width' || key === 'height' || key === 'initialTime' || key === 'playbackRate') { obj[key] = +value; } - else if (key === 'src' || key === 'poster') { + else if (key === 'src' || key === 'poster' || key === 'objectFit' || key === 'backgroundColor') { obj[key] = value; } - else if (key === 'loop' || key === 'muted') { - obj[key] = value === 'true'; + else if (key === 'live' || key === 'controls' || key === 'showProgress' || key === 'showProgressInControlMode' + || key === 'autoplay' || key === 'loop' || key === 'muted' || key === 'obeyMuteSwitch' + || key === 'enableProgressGesture' || key === 'enablePlayGesture' || key === 'showCenterPlayBtn') { + obj[key] = value === 'True'; } }, - WXVideoPlay(id) { - const obj = getObject(id); - if (!obj) { - return; - } - obj.play(); - }, WXVideoAddListener(id, key) { - const obj = getObject(id); - if (!obj) { - return; - } - obj[key]((e) => { + getObject(id)?.[key]((e) => { moduleHelper.send('OnVideoCallback', JSON.stringify({ callbackId: id, type: key, - position: e && e.position, - buffered: e && e.buffered, - duration: e && e.duration, - errMsg: e && e.errMsg, + position: e?.position, + buffered: e?.buffered ? Number(e.buffered) : undefined, + duration: e?.duration, + errMsg: e?.errMsg, })); if (key === 'onError') { GameGlobal.enableTransparentCanvas = false; @@ -55,54 +46,31 @@ export default { } }); }, - WXVideoDestroy(id) { - const obj = getObject(id); - if (!obj) { - return; - } - obj.destroy(); - GameGlobal.enableTransparentCanvas = false; + WXVideoRemoveListener(id, key) { + getObject(id)?.[key](); }, - WXVideoExitFullScreen(id) { - const obj = getObject(id); - if (!obj) { - return; + WXVideoDestroy(id, isLast) { + getObject(id)?.destroy(); + if (isLast) { + GameGlobal.enableTransparentCanvas = false; } - obj.exitFullScreen(); + }, + WXVideoPlay(id) { + getObject(id)?.play(); }, WXVideoPause(id) { - const obj = getObject(id); - if (!obj) { - return; - } - obj.pause(); - }, - WXVideoRequestFullScreen(id, direction) { - const obj = getObject(id); - if (!obj) { - return; - } - obj.requestFullScreen(direction); - }, - WXVideoSeek(id, time) { - const obj = getObject(id); - if (!obj) { - return; - } - obj.seek(time); + getObject(id)?.pause(); }, WXVideoStop(id) { - const obj = getObject(id); - if (!obj) { - return; - } - obj.stop(); + getObject(id)?.stop(); }, - WXVideoRemoveListener(id, key) { - const obj = getObject(id); - if (!obj) { - return; - } - obj[key](); + WXVideoSeek(id, time) { + getObject(id)?.seek(time); + }, + WXVideoRequestFullScreen(id, direction) { + getObject(id)?.requestFullScreen(direction); + }, + WXVideoExitFullScreen(id) { + getObject(id)?.exitFullScreen(); }, }; diff --git a/Runtime/playable-default/unity-sdk/video.js.meta b/Runtime/playable-default/unity-sdk/video.js.meta index 0a160e7c2..5a0eb0425 100644 --- a/Runtime/playable-default/unity-sdk/video.js.meta +++ b/Runtime/playable-default/unity-sdk/video.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 28ca988d10ebc58dde845c1355456359 + guid: 4617cacde907f14e6a7ba5520e5feb86 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/unity-sdk/video.meta b/Runtime/playable-default/unity-sdk/video.meta index 18b67a416..2b8800c6a 100644 --- a/Runtime/playable-default/unity-sdk/video.meta +++ b/Runtime/playable-default/unity-sdk/video.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 1dcd303fb66477ceb547d88206d5a98d +guid: ad29f4ae0e705ac583eb65a4f0eaf76a folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/playable-default/unity-sdk/video/index.js b/Runtime/playable-default/unity-sdk/video/index.js index c94034672..6fa2ac90a 100644 --- a/Runtime/playable-default/unity-sdk/video/index.js +++ b/Runtime/playable-default/unity-sdk/video/index.js @@ -171,6 +171,12 @@ function _JS_Video_Create(url) { function _JS_Video_Destroy(video) { debugLog('_JS_Video_Destroy', video); videoInstances[video].destroy(); + const Module = GameGlobal.manager.gameInstance.Module; + const { GL } = Module; + const gl = GL.currentContext.GLctx; + if (!isWebVideo && gl.emscriptenGLX && Module._glxVideoDestroy) { + Module._glxVideoDestroy(video); + } delete videoInstances[video]; } function _JS_Video_Duration(video) { @@ -375,7 +381,29 @@ function _JS_Video_UpdateToTexture(video, tex) { if (!FrameworkData) { return false; } + const Module = GameGlobal.manager.gameInstance.Module; const { GL, GLctx } = FrameworkData; + const gl = GL.currentContext.GLctx; + + if (!isWebVideo && Module._glxVideoUpdateToTexture && gl.emscriptenGLX) { + const data = v.frameData?.data; + const source = supportVideoFrame ? data : new Uint8ClampedArray(data); + const byteLength = supportVideoFrame ? 0 : source.byteLength; + let sourceIdOrPtr; + if (supportVideoFrame) { + sourceIdOrPtr = source.__uid; + } + else { + sourceIdOrPtr = Module._glxGetVideoTempBuffer(video, byteLength); + if (sourceIdOrPtr) { + Module.HEAPU8.set(source, sourceIdOrPtr); + } + } + + Module._glxVideoUpdateToTexture(v, supportVideoFrame, tex, v.videoWidth, v.videoHeight, sourceIdOrPtr); + return true; + } + GLctx.pixelStorei(GLctx.UNPACK_FLIP_Y_WEBGL, true); diff --git a/Runtime/playable-default/unity-sdk/video/index.js.meta b/Runtime/playable-default/unity-sdk/video/index.js.meta index b68d9b9fb..a58d12c8e 100644 --- a/Runtime/playable-default/unity-sdk/video/index.js.meta +++ b/Runtime/playable-default/unity-sdk/video/index.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 1cf39f45e9f8f334b9496f7588eedaa4 + guid: 303061e6de182dbcb97c937e0a7152cd DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/wasmcode.meta b/Runtime/playable-default/wasmcode.meta index da0551c17..7385f426b 100644 --- a/Runtime/playable-default/wasmcode.meta +++ b/Runtime/playable-default/wasmcode.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ef14be51b471245848e73dfab9b2182d +guid: ebf517a71e316995eefb70eb4bd8353b folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/playable-default/wasmcode/game.js.meta b/Runtime/playable-default/wasmcode/game.js.meta index c5bf9b9dc..c674da653 100644 --- a/Runtime/playable-default/wasmcode/game.js.meta +++ b/Runtime/playable-default/wasmcode/game.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: f7e3ac90e99fb0459e563cc66da25b12 + guid: 9807e3e1e38bbc086311df398175b112 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/playable-default/weapp-adapter.js.meta b/Runtime/playable-default/weapp-adapter.js.meta index 38cf2b8df..144415d37 100644 --- a/Runtime/playable-default/weapp-adapter.js.meta +++ b/Runtime/playable-default/weapp-adapter.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 11a621fca1bb459797abd39cb47896f0 + guid: 33f69186700c8421b134d74aefc42258 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/check-version.js.meta b/Runtime/wechat-default/check-version.js.meta index c727e9945..4208c818b 100644 --- a/Runtime/wechat-default/check-version.js.meta +++ b/Runtime/wechat-default/check-version.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 08990d064137d4a3b95cfea917db95b2 + guid: dec6b543c309cb6a7c79341083aab0ad DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/data-package.meta b/Runtime/wechat-default/data-package.meta index a34a22e36..dcf8a6456 100644 --- a/Runtime/wechat-default/data-package.meta +++ b/Runtime/wechat-default/data-package.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 34b509cb0f1b121aad5bf0e9cd7e98e7 +guid: dbf6b47615f62416f4ebfc6fa98c2c38 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/wechat-default/data-package/game.js.meta b/Runtime/wechat-default/data-package/game.js.meta index f2676b134..49f553a49 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: ee42c1569d46364a6beab2147613fc21 + guid: cdccde742d2769ee1b50741426715715 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/events.js.meta b/Runtime/wechat-default/events.js.meta index f1d4f4315..ecafef9e5 100644 --- a/Runtime/wechat-default/events.js.meta +++ b/Runtime/wechat-default/events.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: f7e81e9863b0bcb5aa77d3fe6a5044bb + guid: 1c3f2c1874c9dac4283486232298ac22 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/game.js b/Runtime/wechat-default/game.js index 2d09dae72..79956cd58 100644 --- a/Runtime/wechat-default/game.js +++ b/Runtime/wechat-default/game.js @@ -27,7 +27,11 @@ const managerConfig = { '$PRELOAD_LIST', ], contextConfig: { - contextType: $WEBGL_VERSION, // 1: webgl1 2: webgl2 + contextType: $WEBGL_VERSION, + contextExt: { + enableGLX: $ENABLE_GLX, + enableMetal: $ENABLE_METAL, + } }, PROFILER_UPLOAD_URL: '', }; diff --git a/Runtime/wechat-default/game.js.meta b/Runtime/wechat-default/game.js.meta index af8549367..5ebaa6e2c 100644 --- a/Runtime/wechat-default/game.js.meta +++ b/Runtime/wechat-default/game.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 87b9ea29438b1352aca33d8d4440d858 + guid: 8a23009e9ac265a7623295feaeb89f10 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/game.json b/Runtime/wechat-default/game.json index c28f9d640..585e691de 100644 --- a/Runtime/wechat-default/game.json +++ b/Runtime/wechat-default/game.json @@ -23,7 +23,7 @@ ], "plugins": { "UnityPlugin": { - "version": "1.2.78", + "version": "1.2.88", "provider": "wxe5a48f1ed5f544b7", "contexts": [ { diff --git a/Runtime/wechat-default/game.json.meta b/Runtime/wechat-default/game.json.meta index ab2ccf30b..a9d35646c 100644 --- a/Runtime/wechat-default/game.json.meta +++ b/Runtime/wechat-default/game.json.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: cf10d27af16f80cc5c697447da01b4ab + guid: 0d99d4902c3ef17b60586f654eb7eeaa DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/images.meta b/Runtime/wechat-default/images.meta index a5593b9bb..0ae1b91f4 100644 --- a/Runtime/wechat-default/images.meta +++ b/Runtime/wechat-default/images.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b2d0f4e4d5a5cafa6138b327b27d29d6 +guid: 58958db21a2ea2574ee42448e4bb9081 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/wechat-default/images/background.jpg.meta b/Runtime/wechat-default/images/background.jpg.meta index 96cc40003..06107e065 100644 --- a/Runtime/wechat-default/images/background.jpg.meta +++ b/Runtime/wechat-default/images/background.jpg.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 04e2709a881f673945411bfe13087789 + guid: bb8daf9c968ba4979bc065cc404186bc DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/images/unity_logo.png.meta b/Runtime/wechat-default/images/unity_logo.png.meta index 15c3cc4f1..8161b3c6a 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: bce68cdf65bac3ee64cc833406089624 + guid: 88a7e6f45b293f13bcd3d681ea3fdb73 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/open-data.meta b/Runtime/wechat-default/open-data.meta index a1068c1b1..cbcc37287 100644 --- a/Runtime/wechat-default/open-data.meta +++ b/Runtime/wechat-default/open-data.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b10b14756771ca2b9f34504ab0988998 +guid: 7889a972a28fce7b5772b8fb3c1cd4b5 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/wechat-default/open-data/data.meta b/Runtime/wechat-default/open-data/data.meta index 3a77364ad..5f58fb456 100644 --- a/Runtime/wechat-default/open-data/data.meta +++ b/Runtime/wechat-default/open-data/data.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c4ecbf09e8afcd556ef30f6976c02310 +guid: 5937d2b9bdfcfc88250cd1d887b53c58 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/wechat-default/open-data/data/index.js.meta b/Runtime/wechat-default/open-data/data/index.js.meta index bcec4bfcb..e620eb2b2 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: 4dcf4a79a2513701a8e9c779bfb019b2 + guid: 9922736d818de574b8c076e6ef2c43fa 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 e964ace07..d66618913 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: b90390a387b715b1d12a1e62128ee503 + guid: a1b67b76361ca99040754cd0a754c387 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/open-data/index.js.meta b/Runtime/wechat-default/open-data/index.js.meta index 6fe0e2fcc..15e27f4eb 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: ef6e313771ee53b2e51893ff4e55d5b0 + guid: 6b894904c86d2b1cb2772848afe79c60 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/open-data/loading.js.meta b/Runtime/wechat-default/open-data/loading.js.meta index e10198ab8..49d88248d 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: c3f18caa2eae5c23c315d7a35380a88b + guid: ff36815e636e73ac6b2f510e8b8d9264 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/open-data/render.meta b/Runtime/wechat-default/open-data/render.meta index af4fadfab..11cd6ba18 100644 --- a/Runtime/wechat-default/open-data/render.meta +++ b/Runtime/wechat-default/open-data/render.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 957fd71d94f59c110008b396a77a7190 +guid: 7a7e65c7aaa435b33959866d5caa20b3 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/wechat-default/open-data/render/image.meta b/Runtime/wechat-default/open-data/render/image.meta index 6cee1c687..097a0c900 100644 --- a/Runtime/wechat-default/open-data/render/image.meta +++ b/Runtime/wechat-default/open-data/render/image.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 815caf87c8030cf7fb74392bbbeeab3c +guid: 05de1ecb5328a562778fcca77b24d1c6 folderAsset: yes DefaultImporter: externalObjects: {} 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 151406964..cad80ce7d 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: 0fc8a4c3908b2feb219abcdbfeee67b3 + guid: 79607f29b24deb530d8070dc9e96a856 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 11bff1ebd..844335637 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: 2e6b5b86c31876af8dc20897ea334d53 + guid: 4b33dee8240174fff3d917545788953a 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 09c7280cc..cf2be1b92 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: 5a9af900688351d88e9a0344a9980a37 + guid: ab00fc3850485ece6bd2a93c20a8a942 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 c78d6aa01..ff5f3a039 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: 45a7f9fae45073725c5ccf9437944ee3 + guid: 0cf0d8ddd1d7b0b23221e9d21be1effa 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 0af132c22..181a811a6 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: d50c386797f223525579ce93c5904dac + guid: f0734d0d0385f0e3edd1c85401d0a424 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 8c21ba1e1..870d7168b 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: 887501989f264e09d555509f6cf21687 + guid: c22c6b89c2823b976d7ec058089a07bd 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 13e16d6e4..0a3e4f5e3 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: 01532496fcae3bcd77c790b38218deb6 + guid: cbb342a24eb2effe4ae164dd86931917 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 58a13a9e5..fdc7ece3d 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: 7c4f3fc685beaa5295e46770fff250fb + guid: db1987c5db35e315b6fd72212f3f2c5b 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 b7431d25f..27278d7aa 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: 4a05502386c37d1029d54d79f62f4209 + guid: 30a5a096edf2453050212911972465f6 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 5aa5c1999..6a98c2b92 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: 042cf54d21d141020480246004b9980e + guid: 2cbd867b9e9b2134472c416745efe316 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/open-data/render/styles.meta b/Runtime/wechat-default/open-data/render/styles.meta index 1a1cb4084..c2c4e9684 100644 --- a/Runtime/wechat-default/open-data/render/styles.meta +++ b/Runtime/wechat-default/open-data/render/styles.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c3ace9839b534221421b5dea5d762967 +guid: 5f91b3db1ecd48349863f4b8385d7d75 folderAsset: yes DefaultImporter: externalObjects: {} 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 2111e85b4..9e912d7ca 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: ceb4b3f059c436c84fd955e740ef922f + guid: 6797ed62c4a195f63f9d475b1b614618 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 b2045260e..21ee489f5 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: 7e014563da6bcbcd73b37ad8de4990d9 + guid: 64890d01b00a4349a0103b8c7aea3c46 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/open-data/render/tpls.meta b/Runtime/wechat-default/open-data/render/tpls.meta index 877f000b0..b90503a4c 100644 --- a/Runtime/wechat-default/open-data/render/tpls.meta +++ b/Runtime/wechat-default/open-data/render/tpls.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4d85d9e58f5ea3a21790805462b64e93 +guid: f533f23cdddc5ce90c9d36b9a8171065 folderAsset: yes DefaultImporter: externalObjects: {} 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 105a3dd4f..3d3187f0e 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: fe02db4d88bc6cac831eb9fefc81db64 + guid: 96c82082f812c871a4e7b96a64c96e64 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 db196436e..217db635a 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: c0ec7d5ba788c8d06379628c54464aff + guid: d37140e40c152a428d3521b3a937870c DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/plugin-config.js.meta b/Runtime/wechat-default/plugin-config.js.meta index fb5439d61..574638d54 100644 --- a/Runtime/wechat-default/plugin-config.js.meta +++ b/Runtime/wechat-default/plugin-config.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: b369fecda3c074fdcb66c716f037e122 + guid: d56725f8aa41bd4d48795c775740af38 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/plugins.meta b/Runtime/wechat-default/plugins.meta index b7d11e2ad..cf84a8d3b 100644 --- a/Runtime/wechat-default/plugins.meta +++ b/Runtime/wechat-default/plugins.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 5e02222b5bf7e07b487cbc9e67b16ae7 +guid: e9f369574d2787be211d3cf973e34c98 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/wechat-default/plugins/check-update.js.meta b/Runtime/wechat-default/plugins/check-update.js.meta index 54f0b2928..476a3eb1b 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: 9301d304ba22996417b2f58ba2e00cb3 + guid: df38cf8dd0ae57d096d58ac5e729eb11 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/plugins/screen-adapter.js.meta b/Runtime/wechat-default/plugins/screen-adapter.js.meta index 6d9ee22d8..65c12ee27 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: 86fb28b75562b17f0b1e54d3277eaa6d + guid: 6bbe24dd32d78dd30b6cc6b17edf6684 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/project.config.json.meta b/Runtime/wechat-default/project.config.json.meta index bc1024bd6..37964025b 100644 --- a/Runtime/wechat-default/project.config.json.meta +++ b/Runtime/wechat-default/project.config.json.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: a118762d22799fd981805f51b94da8aa + guid: d21e59125f86402658bcfbf148525279 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/texture-config.js.meta b/Runtime/wechat-default/texture-config.js.meta index 89113ed1a..15a13ebc2 100644 --- a/Runtime/wechat-default/texture-config.js.meta +++ b/Runtime/wechat-default/texture-config.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: c71883cf1e44c24f13f07491abbcfc32 + guid: 0624dfeb4d23349d55be3cd9d4194db2 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-namespace.js.meta b/Runtime/wechat-default/unity-namespace.js.meta index 53fa0156b..49ab7f7f7 100644 --- a/Runtime/wechat-default/unity-namespace.js.meta +++ b/Runtime/wechat-default/unity-namespace.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 64bbf9a904d2ceed1493e3d3794760b3 + guid: 9862bce86272a362700b7ce78c879b1d DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk.meta b/Runtime/wechat-default/unity-sdk.meta index f96601f5c..1b8bf3313 100644 --- a/Runtime/wechat-default/unity-sdk.meta +++ b/Runtime/wechat-default/unity-sdk.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 636a293199f14ca1076123fe41251c4c +guid: 702e1d2b453a623b3aba1c16def4d51b folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/wechat-default/unity-sdk/TCPSocket.meta b/Runtime/wechat-default/unity-sdk/TCPSocket.meta index 64c46c1bd..c117c8195 100644 --- a/Runtime/wechat-default/unity-sdk/TCPSocket.meta +++ b/Runtime/wechat-default/unity-sdk/TCPSocket.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 31e5a2580d201cbc5bfe57a0cca8a164 +guid: b7576951230995be716df42cff7ed7b7 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/wechat-default/unity-sdk/TCPSocket/index.js.meta b/Runtime/wechat-default/unity-sdk/TCPSocket/index.js.meta index 120d1b226..f3d464cbb 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: 4cb2667a0764c2b084353d12c787b194 + guid: c2a5b38393d5efe3b9d9b34949feed5e DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/UDPSocket.meta b/Runtime/wechat-default/unity-sdk/UDPSocket.meta index 10c5d3096..1cefd8127 100644 --- a/Runtime/wechat-default/unity-sdk/UDPSocket.meta +++ b/Runtime/wechat-default/unity-sdk/UDPSocket.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 24d393bee24440ad8b3b88a2969e865e +guid: 2f949c615cf3a94a651f3b2455d13fc5 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/wechat-default/unity-sdk/UDPSocket/index.js.meta b/Runtime/wechat-default/unity-sdk/UDPSocket/index.js.meta index df6a2ca81..9501a377e 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: f1b259c827aadf981e4d4e2fa041f633 + guid: e5455292991c82bc3f8fcb9a88503115 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/ad.js.meta b/Runtime/wechat-default/unity-sdk/ad.js.meta index f4fe2085e..0dc7970ad 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: 1a0172f85296ce351df69bada3ebe230 + guid: 1b3a1398fe392a8ffba63a388de8a72e DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/audio.meta b/Runtime/wechat-default/unity-sdk/audio.meta index 88bb7066a..085a9cf18 100644 --- a/Runtime/wechat-default/unity-sdk/audio.meta +++ b/Runtime/wechat-default/unity-sdk/audio.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 01d1444a898306e5a917a1bcb42751b7 +guid: 2bff8702010949ecf6f1d4387bd4a00b folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/wechat-default/unity-sdk/audio/common.js.meta b/Runtime/wechat-default/unity-sdk/audio/common.js.meta index 1fa0af070..2f3595bc1 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: 5ef796811e2ea57efd33b6b479cf99f7 + guid: f41530ec8c4f589cdd814abbb2672c41 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 4a860ae78..98a1dce01 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: 2f8144957c816191d9959dab3c758fba + guid: 69cbb44f2ee7109d60196bf94db05476 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 f468fe7b2..53ed55c50 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: 33b6f9f62147eeed040fba150e95ef2a + guid: 96576b7b4f150ec3822ffd4289d497e0 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 ae3e09392..dce909a56 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: d5878486cc38f9b7cba9c873f100bdd8 + guid: 94f71ffbd9395b9ff4960f75ddb1b3a5 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 644b398b3..4bedf0d8b 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: aa67032c25061ac24efa267a9ee0aeb3 + guid: 8f112ebada79ceca9f4049fb7f479945 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/audio/unity-audio.js b/Runtime/wechat-default/unity-sdk/audio/unity-audio.js index 83230ae12..077f0e73c 100644 --- a/Runtime/wechat-default/unity-sdk/audio/unity-audio.js +++ b/Runtime/wechat-default/unity-sdk/audio/unity-audio.js @@ -1050,6 +1050,9 @@ export default { if (WEBAudio.audioWebSupport === 0 || WEBAudio.audioWebEnabled === 0) { return; } + if (WEBAudio.audioContext && WEBAudio.audioContext.state !== 'suspended') { + return; + } resumeWebAudio(); }, _JS_Sound_Set3D(channelInstance, threeD) { 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 527f1d3d8..c530110d9 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: 8c87e0d4e8f54f4b1bd6e5e6dca7d729 + guid: a6931680706abfc3ea9698299681ec1f 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 e51ba4295..980c64a18 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: 848d8647b1b4f0ca60071f31e5fb7d49 + guid: b891b1ca7f437032955042c2aa3954c9 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/authorize.js.meta b/Runtime/wechat-default/unity-sdk/authorize.js.meta index 711cca98f..7a01374d9 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: af0fdb67c5abe65fb48543e712910096 + guid: cbfbbbb3ff87f84e02f740aaf66e4a15 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/bluetooth.meta b/Runtime/wechat-default/unity-sdk/bluetooth.meta index 098b203e9..94c409730 100644 --- a/Runtime/wechat-default/unity-sdk/bluetooth.meta +++ b/Runtime/wechat-default/unity-sdk/bluetooth.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 8de9fa480c2e7170a235a4b8690e4f8b +guid: 0d8feb436f361ccf6a8c6ec67c90f14b folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/wechat-default/unity-sdk/bluetooth/index.js.meta b/Runtime/wechat-default/unity-sdk/bluetooth/index.js.meta index 54a25c6f2..df43f9103 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: 6861940b70f080c12a73d4f2fade22b2 + guid: c47705a4254a8603cc59d3444faa7177 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/camera.js.meta b/Runtime/wechat-default/unity-sdk/camera.js.meta index 152f64d14..bd7837fed 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: da6b0961ca20b6c38b824b4e355a8d1a + guid: 390e69d809fcf245443442a1bb5c4dab 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 2babd6aba..d32720d8b 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: 01e3f1687b78cc62e0bdca75195a4b49 + guid: b7ba2ace2c50d1a0a72e80b14cea3182 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/canvas.js.meta b/Runtime/wechat-default/unity-sdk/canvas.js.meta index 6afe847fe..10b3e8bd0 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: cde23dc6001d7b438aa351389fd66b2e + guid: 6edf6de1ff1ea698171fdbfe7dda6e9d DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/chat.js.meta b/Runtime/wechat-default/unity-sdk/chat.js.meta index 992f3e0be..710c66e07 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: fa3dbb6a100ff2caa6d7996ea9187444 + guid: e6acb1eb972634f5a5f945d0ed25a33a DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/cloud.js.meta b/Runtime/wechat-default/unity-sdk/cloud.js.meta index 17bd223d8..9cb46278c 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: 8bbd03bd05e560ab282270648b0e34d7 + guid: d4f91d679ee22613cf6cd25939b03ebc DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/conf.js.meta b/Runtime/wechat-default/unity-sdk/conf.js.meta index b9125df8b..612b4fb2a 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: e75228391439fe679264ba3e98658140 + guid: 31193212819136a31f574f4458ab4d34 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 94939bbfb..f49fd8269 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: a3aea3a2f095850a8d2e0c2568ab49a5 + guid: 77c7ad26166cada5e7cda70b4f333577 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/fix.js.meta b/Runtime/wechat-default/unity-sdk/fix.js.meta index 87d695000..75cf1ab4e 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: 836b8f6a49a681799ae0e793fdd3f08b + guid: 5d7fc31c48d3dbe945d480d56db9ac74 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/font.meta b/Runtime/wechat-default/unity-sdk/font.meta index 2e390981a..a7ae76dc7 100644 --- a/Runtime/wechat-default/unity-sdk/font.meta +++ b/Runtime/wechat-default/unity-sdk/font.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3c1954bf20418d7e4ee6799dac4212b6 +guid: 8f02a827d71db91787953d861518f417 folderAsset: yes DefaultImporter: externalObjects: {} 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 618a6e86f..8406b03e2 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: a64a001653973190bee1fed532a3dbaf + guid: e3f44018f5683da052d7ca819ce98beb DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/font/index.js b/Runtime/wechat-default/unity-sdk/font/index.js index 925e34c8d..33c798af7 100644 --- a/Runtime/wechat-default/unity-sdk/font/index.js +++ b/Runtime/wechat-default/unity-sdk/font/index.js @@ -170,8 +170,8 @@ function WXGetFontRawData(conf, callbackId, forceFallback = false) { } }) .catch((err) => { - if (err.errmsg === 'no support font' && forceFallback === false) { - + + if (!loadFromRemote && !!config && forceFallback === false) { WXGetFontRawData(conf, callbackId, true); } else { diff --git a/Runtime/wechat-default/unity-sdk/font/index.js.meta b/Runtime/wechat-default/unity-sdk/font/index.js.meta index a74499861..5a5387b88 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: 6616fd4c795a0a6e7da301bd05841068 + guid: f78d9ae19a5eac35aa985bb0cb1d6e98 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 858d5b775..dbe2367d9 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: 4d3587d639a509170c97cdeece5aa743 + guid: 034b46825900af7a879334879d6d7ad7 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 505bac338..cf33d3aae 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: 36cd5809e69b06c5068e7f2c67de60d6 + guid: 3b1ebd3f2de2a57cd44ef272e7e5388d 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 1d3a21438..90d4e8e97 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: 4cd87b88162497150395970cfb688c86 + guid: c3a30de76d5ad48522daa4bf92c1d268 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/fs.js.meta b/Runtime/wechat-default/unity-sdk/fs.js.meta index 9032b0015..2933d318d 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: cc9eb39d4db78c6001c408ec9fa723d0 + guid: 163ab231394354c0ee41fe9b4b71ae61 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/game-club.js.meta b/Runtime/wechat-default/unity-sdk/game-club.js.meta index 8631ccf61..13b33721e 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: e4713d7374ed1d6166ce18c3dfd439fd + guid: 29058bb680adb4d10c08cd72c998a01e 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 091b97de3..d5970b11c 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: aa10741dd9ee7e7d0eecaaa81d0af002 + guid: c89eabe8cf73a8786fe3a6161af5deee DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/gyroscope.meta b/Runtime/wechat-default/unity-sdk/gyroscope.meta index ea9c5d4fc..a9179ccec 100644 --- a/Runtime/wechat-default/unity-sdk/gyroscope.meta +++ b/Runtime/wechat-default/unity-sdk/gyroscope.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 24a3cb99c7931cf84390598a7cf23497 +guid: e8e98e04939ec8103178a312d168f242 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/wechat-default/unity-sdk/gyroscope/index.js.meta b/Runtime/wechat-default/unity-sdk/gyroscope/index.js.meta index 486e1d80c..d710c8ffe 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: 0a21b5d3bb581112985175f4ad715f51 + guid: e0edd23a8b766f6c12d889770b1ef1e8 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/index.js.meta b/Runtime/wechat-default/unity-sdk/index.js.meta index acdcde7f4..401d6851c 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: 2c84709d7230887c259d30c9ef7f9c75 + guid: 830542ea144a19e40912f92dc47433de DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/logger.js.meta b/Runtime/wechat-default/unity-sdk/logger.js.meta index c0269b8df..969c35c66 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: 19f1459cc0780a94606ec758192e8daf + guid: 678839f038665b02baf9ebb293b1535c DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/mobileKeyboard.meta b/Runtime/wechat-default/unity-sdk/mobileKeyboard.meta index 7ac2f10da..7bb4289cd 100644 --- a/Runtime/wechat-default/unity-sdk/mobileKeyboard.meta +++ b/Runtime/wechat-default/unity-sdk/mobileKeyboard.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 25402e5e6ae3f510e26869e8ee5c74df +guid: dbd662ec6d1d50bca38a11ec4640d246 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/wechat-default/unity-sdk/mobileKeyboard/index.js.meta b/Runtime/wechat-default/unity-sdk/mobileKeyboard/index.js.meta index e4e4ee7eb..45f5f1ce7 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: 7d7803565a8182e31b497824c037ed5f + guid: bcb299f3bad28032941ae8d48ac1b5e9 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 604aa1ac3..f5d59d5f0 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: 57451df585efc1811d2257c5280d03ca + guid: 4b1c6bb090a732ca960d82cc5f1ceaea DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/open-data.js b/Runtime/wechat-default/unity-sdk/open-data.js index f5e16425f..377c1f5f6 100644 --- a/Runtime/wechat-default/unity-sdk/open-data.js +++ b/Runtime/wechat-default/unity-sdk/open-data.js @@ -13,6 +13,7 @@ var SharedCanvasMode; let sharedCanvasMode; let timerId; let textureObject = null; +let unityTextureObject = null; let textureId; function getOpenDataContext(mode) { @@ -51,34 +52,47 @@ function hookUnityRender() { if (!textureId) { return; } - const { GL } = GameGlobal.manager.gameInstance.Module; + const Module = GameGlobal.manager.gameInstance.Module; + const { GL } = Module; const gl = GL.currentContext.GLctx; - if (!textureObject) { - textureObject = gl.createTexture(); - gl.bindTexture(gl.TEXTURE_2D, textureObject); - 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); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + const isLinearColorSpace = GameGlobal.unityNamespace.unityColorSpace === 'Linear'; + + if (gl.emscriptenGLX) { + Module.ccall('glxShowOpenData', null, ['number', 'number', 'bool'], [textureId, getSharedCanvas().__uid(), isLinearColorSpace]); } else { - gl.bindTexture(gl.TEXTURE_2D, textureObject); - if (GameGlobal.unityNamespace.unityColorSpace === 'Linear') { - gl.texImage2D(gl.TEXTURE_2D, 0, gl.SRGB8_ALPHA8, gl.RGBA, gl.UNSIGNED_BYTE, getSharedCanvas()); + const commonTexImage2DHandler = () => { + + if (textureId) { + gl.bindTexture(gl.TEXTURE_2D, GL.textures[textureId]); + if (isLinearColorSpace) { + 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()); + } + } + }; + if (!textureObject) { + textureObject = gl.createTexture(); + + unityTextureObject = GL.textures[textureId]; + + GL.textures[textureId] = textureObject; + commonTexImage2DHandler(); + + 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); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); } else { - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, getSharedCanvas()); + + commonTexImage2DHandler(); } + timerId = requestAnimationFrame(hookUnityRender); } - GL.textures[textureId] = textureObject; - timerId = requestAnimationFrame(hookUnityRender); } function stopLastRenderLoop() { @@ -98,10 +112,19 @@ function stopHookUnityRender() { sharedCanvas.width = 1; sharedCanvas.height = 1; - const { GL } = GameGlobal.manager.gameInstance.Module; + const Module = GameGlobal.manager.gameInstance.Module; + const { GL } = Module; const gl = GL.currentContext.GLctx; - gl.deleteTexture(textureObject); - textureObject = null; + if (textureObject) { + gl.deleteTexture(textureObject); + GL.textures[textureId] = unityTextureObject; + textureObject = null; + unityTextureObject = null; + } + + if (gl.emscriptenGLX) { + Module.ccall('glxHideOpenData', null, [], []); + } } wx.onShow(() => { if (cachedOpenDataContext) { diff --git a/Runtime/wechat-default/unity-sdk/open-data.js.meta b/Runtime/wechat-default/unity-sdk/open-data.js.meta index 4b8bb0d0b..ae2837a29 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: 29c375995da1176b8c021fa3b9b67068 + guid: 51c73b71b06a99a0a94f94068552600b DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/recorder.js.meta b/Runtime/wechat-default/unity-sdk/recorder.js.meta index af4ccc77f..38dc99892 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: a80a5d36627b36c052e571c8a3fa4975 + guid: b88edf2822fc1abd696a1b68c441f12d DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/resType.js b/Runtime/wechat-default/unity-sdk/resType.js index 1cc38b161..a4a98d884 100644 --- a/Runtime/wechat-default/unity-sdk/resType.js +++ b/Runtime/wechat-default/unity-sdk/resType.js @@ -93,6 +93,14 @@ export const ResType = { top: 'number', width: 'number', }, + OfficialComponentsInfo: { + notificationComponentInfo: 'OfficialComponentInfo', + }, + OfficialComponentInfo: { + boundingClientRect: 'ClientRect', + isVisible: 'bool', + name: 'string', + }, GetStorageInfoSyncOption: { currentSize: 'number', keys: 'string[]', @@ -180,10 +188,15 @@ export const ResType = { downstreamThroughputKbpsEstimate: 'number', estimate_nettype: 'number', fetchStart: 'number', + httpDNSDomainLookUpEnd: 'number', + httpDNSDomainLookUpStart: 'number', httpRttEstimate: 'number', + invokeStart: 'number', peerIP: 'string', port: 'number', protocol: 'string', + queueEnd: 'number', + queueStart: 'number', receivedBytedCount: 'number', redirectEnd: 'number', redirectStart: 'number', @@ -518,6 +531,12 @@ export const ResType = { status: 'number', errMsg: 'string', }, + GetChatToolInfoSuccessCallbackResult: { + cloudID: 'string', + encryptedData: 'string', + errMsg: 'string', + iv: 'string', + }, GetClipboardDataSuccessCallbackOption: { data: 'string', errMsg: 'string', @@ -555,6 +574,10 @@ export const ResType = { signature: 'string', errMsg: 'string', }, + GetGameExptInfoSuccessCallbackResult: { + list: 'object', + errMsg: 'string', + }, GetGroupEnterInfoError: { errMsg: 'string', errCode: 'number', @@ -565,6 +588,20 @@ export const ResType = { errMsg: 'string', iv: 'string', }, + GetGroupMembersInfoSuccessCallbackResult: { + membersInfo: 'ResultOpenDataContextUserInfo[]', + errMsg: 'string', + }, + ResultOpenDataContextUserInfo: { + avatarUrl: 'string', + city: 'string', + country: 'string', + gender: 'number', + language: 'string', + nickName: 'string', + openId: 'string', + province: 'string', + }, GetInferenceEnvInfoSuccessCallbackResult: { ver: 'string', errMsg: 'string', @@ -667,7 +704,7 @@ export const ResType = { errMsg: 'string', openIdList: 'string[]', }, - RequestFailCallbackErr: { + LoginFailCallbackErr: { errMsg: 'string', errno: 'number', }, @@ -736,9 +773,8 @@ export const ResType = { OnDeviceOrientationChangeListenerResult: { value: 'string', }, - Error: { + ListenerError: { message: 'string', - stack: 'string', }, OnGamepadConnectedListenerResult: { gamepad: 'string', @@ -784,6 +820,9 @@ export const ResType = { networkType: 'string', weakNet: 'bool', }, + OnOfficialComponentsInfoChangeListenerResult: { + OfficialComponentsInfo: 'OfficialComponentsInfo', + }, OnScreenRecordingStateChangedListenerResult: { state: 'string', }, @@ -846,6 +885,9 @@ export const ResType = { windowHeight: 'number', windowWidth: 'number', }, + OnWindowStateChangeListenerResult: { + state: 'string', + }, OpenCardRequestInfo: { cardId: 'string', code: 'string', @@ -889,12 +931,6 @@ export const ResType = { errMsg: 'string', errCode: 'number', }, - RequestMidasFriendPaymentSuccessCallbackResult: { - cloudID: 'string', - encryptedData: 'string', - errMsg: 'string', - iv: 'string', - }, MidasPaymentError: { errMsg: 'string', errCode: 'number', @@ -940,6 +976,10 @@ export const ResType = { scanType: 'string', errMsg: 'string', }, + GroupMemberInfo: { + members: 'string[]', + errMsg: 'string', + }, SetBLEMTUFailCallbackResult: { mtu: 'number', }, diff --git a/Runtime/wechat-default/unity-sdk/resType.js.meta b/Runtime/wechat-default/unity-sdk/resType.js.meta index 0f76e2945..f5b965a4d 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: 10b1ed92a5f07e5f4d31e25500664877 + guid: b74ced2740b9e67f9548884d5933ea1d DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/resTypeOther.js.meta b/Runtime/wechat-default/unity-sdk/resTypeOther.js.meta index 74a8e330c..8330ab0a7 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: 72384d9b6cc9a07713d38ee51f46b01c + guid: 3e32865022aeab643a812bfce662e162 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/response.js.meta b/Runtime/wechat-default/unity-sdk/response.js.meta index 51647462a..3a6aaedce 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: 173fd5185c793c3e6d51b47419e4604b + guid: 5edcbd79df6e2fcaa74e6a1ce4559191 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/sdk.js b/Runtime/wechat-default/unity-sdk/sdk.js index 0c1957ed6..9046d24b0 100644 --- a/Runtime/wechat-default/unity-sdk/sdk.js +++ b/Runtime/wechat-default/unity-sdk/sdk.js @@ -27,10 +27,12 @@ function WX_OneWayNoFunction(functionName, ...params) { } -const onlyReadyResponse = [ +const onlyReadResponse = [ 'getSystemSetting', 'getAppAuthorizeSetting', ]; + +const needParseJson = ['WXMiniReportManagerReport']; // eslint-disable-next-line @typescript-eslint/naming-convention function WX_SyncFunction(functionName, ...params) { return wx[functionName.replace(/^\w/, (a) => a.toLowerCase())](...params); @@ -72,6 +74,10 @@ export default { ...config, success(res) { formatResponse(successType, res); + + if (lowerFunctionName === 'getGameExptInfo') { + res.list = JSON.stringify(res.list); + } moduleHelper.send(`${functionName}Callback`, JSON.stringify({ callbackId, type: 'success', res: JSON.stringify(res), })); @@ -234,7 +240,7 @@ export default { }, WX_SyncFunction_t(functionName, returnType) { const res = WX_SyncFunction(functionName); - if (onlyReadyResponse.includes(functionName.replace(/^\w/, (a) => a.toLowerCase()))) { + if (onlyReadResponse.includes(functionName.replace(/^\w/, (a) => a.toLowerCase()))) { formatResponse(returnType, JSON.parse(JSON.stringify(res))); return JSON.stringify(res); } @@ -355,7 +361,8 @@ export default { } ClassOnEventLists[className + functionName][id + eventName].push(callback); // WXVideoDecoder OnEvent 不规范 特殊处理 - if (className === 'WXVideoDecoder') { + // update: 2025.9.27: 严重怀疑之前 WXPageManager 压根没有跑通过事件监听,跑到下面去了 + if (className === 'WXVideoDecoder' || className === 'WXPageManager') { obj[functionName.replace(/^\w/, (a) => a.toLowerCase())](eventName, callback); } else { @@ -378,7 +385,8 @@ export default { } ClassOnEventLists[className + functionName][id + eventName].forEach((v) => { - if (className === 'WXVideoDecoder') { + + if (className === 'WXVideoDecoder' || className === 'WXPageManager') { obj[functionName.replace(/^\w/, (a) => a.toLowerCase())](eventName, v); } else { @@ -391,6 +399,10 @@ export default { WX_ClassOneWayNoFunction(className, functionName, id); }, WX_ClassOneWayNoFunction_vs(className, functionName, id, param1) { + if (needParseJson.includes(className + functionName)) { + // eslint-disable-next-line no-param-reassign + param1 = JSON.parse(param1); + } WX_ClassOneWayNoFunction(className, functionName, id, param1); }, WX_ClassOneWayNoFunction_t(className, functionName, returnType, id) { diff --git a/Runtime/wechat-default/unity-sdk/sdk.js.meta b/Runtime/wechat-default/unity-sdk/sdk.js.meta index f6bfd40e7..f79c8db33 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: 0c1be673a54c09b04401bd1bb009a1ff + guid: 3274ef11e41fd13438ec7a69c04c590f DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/share.js.meta b/Runtime/wechat-default/unity-sdk/share.js.meta index 1b85ecf6c..cff32f8bf 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: 6304e6cd9bc13beaef1dad6de488e7c3 + guid: cf4c6f5df70c169741c17e454d174281 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/storage.js.meta b/Runtime/wechat-default/unity-sdk/storage.js.meta index b421802bd..f5a6f2162 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: 03028f4209488f4dc61378fc1d34ecde + guid: b59661894ace0ee53b5f89af8d461a1c DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/texture.js b/Runtime/wechat-default/unity-sdk/texture.js index ad06d3ebd..242514223 100644 --- a/Runtime/wechat-default/unity-sdk/texture.js +++ b/Runtime/wechat-default/unity-sdk/texture.js @@ -39,8 +39,15 @@ const mod = { if (hasCheckSupportedExtensions) { return GameGlobal.TextureCompressedFormat; } - const list = canvas - .getContext(GameGlobal.managerConfig.contextConfig.contextType === 2 ? 'webgl2' : 'webgl') + + const isSupportEmscriptenGLX = wx.env.isSuppportEmscriptenGLX || wx.env.isSupportEmscriptenGLX; + const isWebGL2 = GameGlobal.managerConfig.contextConfig.contextType === 2; + let finalContextType = isWebGL2 ? 'webgl2' : 'webgl'; + if (isSupportEmscriptenGLX) { + finalContextType = isWebGL2 ? 'wxwebgl2' : 'wxwebgl'; + } + const list = canvas + .getContext(finalContextType) .getSupportedExtensions(); const noneLimitSupportedTextures = ['']; // 兜底采用png GameGlobal.TextureCompressedFormat = ''; diff --git a/Runtime/wechat-default/unity-sdk/texture.js.meta b/Runtime/wechat-default/unity-sdk/texture.js.meta index ec0044690..e93ae9d1c 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: 4b7b19f763dcf75e368f1143c51c0a37 + guid: 081e08877b3d81aa68c211df2024121f DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/touch.meta b/Runtime/wechat-default/unity-sdk/touch.meta index 4e5da0adc..926c2735c 100644 --- a/Runtime/wechat-default/unity-sdk/touch.meta +++ b/Runtime/wechat-default/unity-sdk/touch.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ff1d22078fe3fc9ee35338f37f5a3afb +guid: b052df860138f7a6c94b1030bb3665e9 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/wechat-default/unity-sdk/touch/index.js.meta b/Runtime/wechat-default/unity-sdk/touch/index.js.meta index 6e3531b6c..2f0c4c576 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: 5d5fadce57574ef4ab6c2aea99ea0f81 + guid: 2216c81615ad85a994bc6057bfb383e8 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 a5bfd89a2..e84027b50 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: 9bb0dc4f529b58a2c4f1fe214ffa10e5 + guid: a68686da17218368252d5fefcc3dc3ff DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/userinfo.js.meta b/Runtime/wechat-default/unity-sdk/userinfo.js.meta index c43c1f6ef..818130325 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: b5f0c6f9b4cd5f93d6a4220595ba7381 + guid: 8ec29df8a469444b7efe5f88ba6a1dd3 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/util.js b/Runtime/wechat-default/unity-sdk/util.js index 3108ab050..ce3058ba6 100644 --- a/Runtime/wechat-default/unity-sdk/util.js +++ b/Runtime/wechat-default/unity-sdk/util.js @@ -174,4 +174,9 @@ export default { WX_SetPreferredFramesPerSecond(fps) { wx.setPreferredFramesPerSecond(fps); }, + WXSetSyncReadCacheEnabled(enabled) { + if (GameGlobal.manager && GameGlobal.manager.fs.setSyncReadCacheEnabled) { + GameGlobal.manager.fs.setSyncReadCacheEnabled(!!enabled); + } + } }; diff --git a/Runtime/wechat-default/unity-sdk/util.js.meta b/Runtime/wechat-default/unity-sdk/util.js.meta index 096eeba5e..3f3e86c8b 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: fecf48b9df838f4076cc2dd24a70a9e4 + guid: 00cd3ab653f4ae6e5b5a432fb808f259 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/utils.js.meta b/Runtime/wechat-default/unity-sdk/utils.js.meta index 0cc67309b..cc5abf915 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: ab3c598b96ab5098c9c96a26580b5fb1 + guid: c1b9f5189c0c1113cddb5bb0db1637da DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/video.js.meta b/Runtime/wechat-default/unity-sdk/video.js.meta index fb16b3fd1..f53782e34 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: 74717a98d6ec41aed2a3bccd8f3713b8 + guid: 746a914d7a8c0a3645108c69e348733c DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/unity-sdk/video.meta b/Runtime/wechat-default/unity-sdk/video.meta index 331f52cb8..7c2a996f8 100644 --- a/Runtime/wechat-default/unity-sdk/video.meta +++ b/Runtime/wechat-default/unity-sdk/video.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 5bddf2d717e56ac9ab9b0dba01966d01 +guid: ff7c5245af2e2f5da4187086acc2f219 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/wechat-default/unity-sdk/video/index.js b/Runtime/wechat-default/unity-sdk/video/index.js index 70041d907..53a12d87f 100644 --- a/Runtime/wechat-default/unity-sdk/video/index.js +++ b/Runtime/wechat-default/unity-sdk/video/index.js @@ -7,8 +7,43 @@ let FrameworkData = null; const isWebVideo = (isH5Renderer && !GameGlobal.isIOSHighPerformanceModePlus) || isPc || isDevtools; const needCache = true; const cacheVideoDecoder = []; -const supportVideoFrame = !!GameGlobal.isIOSHighPerformanceModePlus; +let supportVideoFrame = !!GameGlobal.isIOSHighPerformanceModePlus; const videoInstances = {}; +class VideoBufferManager { + videoBuffers = new Map(); + getTempBuffer(videoId, byteLength) { + const Module = GameGlobal.manager.gameInstance.Module; + if (this.videoBuffers.has(videoId)) { + const bufferInfo = this.videoBuffers.get(videoId); + if (bufferInfo.byteLength >= byteLength) { + return bufferInfo.ptr; + } + if (bufferInfo.ptr !== null) { + Module._free(bufferInfo.ptr); + } + } + const newPtr = Module._malloc(byteLength); + if (newPtr === null) { + return null; + } + this.videoBuffers.set(videoId, { byteLength, ptr: newPtr }); + return newPtr; + } + destroyTempBuffer(videoId) { + if (this.videoBuffers.has(videoId)) { + const Module = GameGlobal.manager.gameInstance.Module; + const bufferInfo = this.videoBuffers.get(videoId); + if (bufferInfo.ptr !== null) { + Module._free(bufferInfo.ptr); + + } + this.videoBuffers.delete(videoId); + } + } +} +; +let videoBufferManager; + function _JS_Video_CanPlayFormat(format, data) { @@ -40,6 +75,12 @@ function _JS_Video_Create(url) { source = FrameworkData.UTF8ToString(url); } debugLog('_JS_Video_Create', source); + if (GameGlobal.mtl) { + supportVideoFrame = false; + if (!videoBufferManager) { + videoBufferManager = new VideoBufferManager(); + } + } if (isWebVideo) { // @ts-ignore const video = GameGlobal.manager.createWKVideo(source, FrameworkData.GLctx); @@ -112,7 +153,7 @@ function _JS_Video_Create(url) { // @ts-ignore videoInstance.currentTime = res.pts / 1000; - if (supportVideoFrame) { + if (supportVideoFrame || GameGlobal.mtl) { videoInstance.frameData?.close?.(); } @@ -174,6 +215,19 @@ function _JS_Video_Create(url) { function _JS_Video_Destroy(video) { debugLog('_JS_Video_Destroy', video); videoInstances[video].destroy(); + const Module = GameGlobal.manager.gameInstance.Module; + const { GL } = Module; + if (GameGlobal.mtl) { + if (!isWebVideo) { + videoBufferManager?.destroyTempBuffer(video); + } + } + else { + const gl = GL.currentContext.GLctx; + if (!isWebVideo && gl.emscriptenGLX && Module._glxVideoDestroy) { + Module._glxVideoDestroy(video); + } + } delete videoInstances[video]; } function _JS_Video_Duration(video) { @@ -378,7 +432,45 @@ function _JS_Video_UpdateToTexture(video, tex) { if (!FrameworkData) { return false; } + const Module = GameGlobal.manager.gameInstance.Module; const { GL, GLctx } = FrameworkData; + + if (!isWebVideo && GameGlobal.mtl) { + if (supportVideoFrame) { + + return false; + } + const data = v.frameData?.data; + const source = supportVideoFrame ? data : new Uint8ClampedArray(data); + const byteLength = supportVideoFrame ? 0 : source.byteLength; + const sourceIdOrPtr = videoBufferManager?.getTempBuffer(video, byteLength); + if (sourceIdOrPtr) { + Module.HEAPU8.set(source, sourceIdOrPtr); + } + return Module._mtlVideoUpdateToTexture(video, supportVideoFrame, tex, v.videoWidth, v.videoHeight, sourceIdOrPtr); + } + + const gl = GL.currentContext.GLctx; + + if (!isWebVideo && Module._glxVideoUpdateToTexture && gl.emscriptenGLX) { + const data = v.frameData?.data; + const source = supportVideoFrame ? data : new Uint8ClampedArray(data); + const byteLength = supportVideoFrame ? 0 : source.byteLength; + let sourceIdOrPtr; + if (supportVideoFrame) { + sourceIdOrPtr = source.__uid; + } + else { + sourceIdOrPtr = Module._glxGetVideoTempBuffer(video, byteLength); + if (sourceIdOrPtr) { + Module.HEAPU8.set(source, sourceIdOrPtr); + } + } + + Module._glxVideoUpdateToTexture(v, supportVideoFrame, tex, v.videoWidth, v.videoHeight, sourceIdOrPtr); + return true; + } + GLctx.pixelStorei(GLctx.UNPACK_FLIP_Y_WEBGL, true); diff --git a/Runtime/wechat-default/unity-sdk/video/index.js.meta b/Runtime/wechat-default/unity-sdk/video/index.js.meta index ffb244bcc..577eb727c 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: 15bf065a071f9fa177264a809bd188d0 + guid: 1af715367d99daae2045f9fa1edbbf10 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/wasmcode.meta b/Runtime/wechat-default/wasmcode.meta index 0950b2f7d..dae1c3807 100644 --- a/Runtime/wechat-default/wasmcode.meta +++ b/Runtime/wechat-default/wasmcode.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4ded0c3020051fbd184aa2ad21ec214d +guid: dfd4c38b176602c72f069ba713598a69 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/wechat-default/wasmcode/game.js.meta b/Runtime/wechat-default/wasmcode/game.js.meta index ab8453416..046e0733e 100644 --- a/Runtime/wechat-default/wasmcode/game.js.meta +++ b/Runtime/wechat-default/wasmcode/game.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: d1b1d6065a73a2a3b30a6f0e28c76383 + guid: f48a75e22c6734a38b9d3ccf4d2207c9 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/weapp-adapter.js.meta b/Runtime/wechat-default/weapp-adapter.js.meta index 2a7a93384..b39ce9003 100644 --- a/Runtime/wechat-default/weapp-adapter.js.meta +++ b/Runtime/wechat-default/weapp-adapter.js.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 - guid: 5c2d89ebc32106884f93f02f15d30d16 + guid: 77a61eab0368e98335636ed9b62a1c39 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/wechat-default/workers.meta b/Runtime/wechat-default/workers.meta index 921ac2074..1fc3b507f 100644 --- a/Runtime/wechat-default/workers.meta +++ b/Runtime/wechat-default/workers.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 84b980f6e2f58ecc258ac99c4f00e378 +guid: e11f9ed1f106be28157431fcb51186f5 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/wechat-default/workers/response.meta b/Runtime/wechat-default/workers/response.meta index 038477f16..cbb4156da 100644 --- a/Runtime/wechat-default/workers/response.meta +++ b/Runtime/wechat-default/workers/response.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: dd1024f3a162dab5a2aad62a8f23acd5 +guid: bdeeb769b538c1f1c61c0e902b600a9c folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/wechat-default/workers/response/index.js.meta b/Runtime/wechat-default/workers/response/index.js.meta index cde573f78..070cfc28c 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: 3e1408148b8be631b1140616c2aac0c0 + guid: 6a92913b6a7b75c8f538809220504347 DefaultImporter: externalObjects: {} userData: diff --git a/WebGLTemplates/WXTemplate2022TJ/index.html b/WebGLTemplates/WXTemplate2022TJ/index.html index 24ed9df79..ee0fda0ff 100644 --- a/WebGLTemplates/WXTemplate2022TJ/index.html +++ b/WebGLTemplates/WXTemplate2022TJ/index.html @@ -393,6 +393,26 @@ WX_RecorderResume() {}, WX_RecorderStart() {}, WX_RecorderStop() {}, + WX_RegisterOnTouchCancelCallback() {}, + WX_RegisterOnTouchEndCallback() {}, + WX_RegisterOnTouchMoveCallback() {}, + WX_RegisterOnTouchStartCallback() {}, + WX_RegisterUDPSocketOnMessageCallback() {}, + WX_RegisterUDPSocketOnErrorCallback() {}, + WX_RegisterUDPSocketOnCloseCallback() {}, + WX_RegisterUDPSocketOnOpenCallback() {}, + WX_RegisterUDPSocketOnMessageCallback() {}, + WX_RegisterUDPSocketOnErrorCallback() {}, + WX_RegisterUDPSocketOnCloseCallback() {}, + WX_RegisterUDPSocketOnOpenCallback() {}, + WX_RegisterTCPSocketOnMessageCallback() {}, + WX_RegisterTCPSocketOnErrorCallback() {}, + WX_RegisterTCPSocketOnCloseCallback() {}, + WX_RegisterTCPSocketOnOpenCallback() {}, + WX_RegisterOnBLECharacteristicValueChangeCallback() {}, + WX_RegisterStartGyroscopeCallback() {}, + WX_RegisterStopGyroscopeCallback() {}, + WX_RegisterOnGyroscopeChangeCallback() {}, WX_UploadFile() {}, WXUploadTaskAbort() {}, WXUploadTaskOffHeadersReceived() {},