diff --git a/CHANGELOG.md b/CHANGELOG.md index c647f3dc3..c1025d228 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,13 +6,13 @@ Removed - 删除功能/接口 Fixed - 修复问题 Others - 其他 --> -## v0.1.27 【普通更新】 +## 2025-7-10 v0.1.27 【普通更新】 ### Feature * 普通:新增 JS_Sound_GetPosition 方法用于获取音频播放位置 * 普通:WebGL2变更为正式特性 * 普通:支持小游戏试玩导出 -## v0.1.26 【普通更新】 +## 2025-5-8 v0.1.26 【普通更新】 ### Feature * 普通:增加禁止多点触控的配置 ### Fixed diff --git a/Editor/BuildProfile.meta b/Editor/BuildProfile.meta new file mode 100644 index 000000000..252f755cb --- /dev/null +++ b/Editor/BuildProfile.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: DytLvSj8UC9CKob0XUy9Y3usKDmX8US1YgxYmBxa1iAZ/I8JbM5wZwE= +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/BuildProfile/lib.meta b/Editor/BuildProfile/lib.meta new file mode 100644 index 000000000..87b4cc3cf --- /dev/null +++ b/Editor/BuildProfile/lib.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: XSwesi78AS28ymfR2HEhHpEBAC2DHupI1hIKP7HApjHRaZgGw+DTwWI= +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Editor/BuildProfile/lib/libwx-metal-cpp.bc b/Editor/BuildProfile/lib/libwx-metal-cpp.bc new file mode 100644 index 000000000..e8ae12117 Binary files /dev/null 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 new file mode 100644 index 000000000..28e81d7a7 --- /dev/null +++ b/Editor/BuildProfile/lib/libwx-metal-cpp.bc.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: c113acfee35db6b5c61fd4a76596cfd3 +DefaultImporter: +externalObjects: {} +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 new file mode 100644 index 000000000..b6f7cf5df --- /dev/null +++ b/Editor/BuildProfile/lib/mtl_library.jslib @@ -0,0 +1,43 @@ +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); + //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); + if(!isSync){ + mtl.batchRenderAsync(merged.buffer, extBuffer); + return null; + } + const result = mtl.batchRender(merged.buffer, extBuffer).buffer; + if(result.byteLength == 0){ + return null;; + } + // 申请内存空间,后续在cpp wasm部分使用,记得释放 + const ptr = Module._malloc(result.byteLength); + // 将数据拷贝到WASM内存 + Module.HEAPU8.set(new Uint8Array(result), ptr); + // 返回结构化的数据信息(指针和长度) + const ret = new DataView(new ArrayBuffer(8)); + ret.setUint32(0, ptr, true); // 指针地址(4字节) + ret.setUint32(4, result.byteLength, true); // 数据长度(4字节) + // 返回合并后的8字节缓冲区指针,记得也要在cpp部分释放 + const retPtr = Module._malloc(8); + Module.HEAPU8.set(new Uint8Array(ret.buffer), retPtr); + return retPtr; + + }, + js_swapWindow: function(){ + mtl.swapWindow(); + } + }); \ No newline at end of file diff --git a/Editor/BuildProfile/lib/mtl_library.jslib.meta b/Editor/BuildProfile/lib/mtl_library.jslib.meta new file mode 100644 index 000000000..3882fefc8 --- /dev/null +++ b/Editor/BuildProfile/lib/mtl_library.jslib.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: dda1926f3454e003333e8085a4f2c0fd +DefaultImporter: +externalObjects: {} +userData: +assetBundleName: +assetBundleVariant: \ No newline at end of file diff --git a/Editor/Playable/WXPlayableConvertCore.cs b/Editor/Playable/WXPlayableConvertCore.cs index 0adcf9a50..673f8716c 100644 --- a/Editor/Playable/WXPlayableConvertCore.cs +++ b/Editor/Playable/WXPlayableConvertCore.cs @@ -5,134 +5,134 @@ using UnityEngine; namespace WeChatWASM { - public class WXPlayableConvertCore - { - static WXPlayableConvertCore() { } - public static WXPlayableEditorScriptObject config => UnityUtil.GetPlayableEditorConf(); - - public static WXConvertCore.WXExportError DoExport(bool buildWebGL = true) + public class WXPlayableConvertCore { - WXConvertCore.isPlayableBuild = true; - // var preCheckResult = WXConvertCore.PreCheck(); - // if (preCheckResult != WXConvertCore.WXExportError.SUCCEED) - // { - // WXConvertCore.isPlayableBuild = false; - // return preCheckResult; - // } - // WXConvertCore.PreInit(); - var exportResult = WXConvertCore.DoExport(); + static WXPlayableConvertCore() { } + public static WXPlayableEditorScriptObject config => UnityUtil.GetPlayableEditorConf(); - WXConvertCore.isPlayableBuild = false; - return exportResult; - } - - public static WXEditorScriptObject GetFakeScriptObject() - { - return SetDefaultProperties(ConvertPlayableConfigToCommon(config)); - } - - public static WXEditorScriptObject ConvertPlayableConfigToCommon( - WXPlayableEditorScriptObject source, - WXEditorScriptObject target = null) - { - // 创建或使用现有的目标实例 - var newTarget = target ?? ScriptableObject.CreateInstance(); - - // 使用序列化方式深度拷贝公共字段 - var so = new SerializedObject(newTarget); - - // 遍历源对象的所有字段 - var sourceType = source.GetType(); - foreach (var sourceField in sourceType.GetFields( - System.Reflection.BindingFlags.Public | - System.Reflection.BindingFlags.Instance | - System.Reflection.BindingFlags.NonPublic)) - { - // 跳过readonly字段 - if (sourceField.IsInitOnly) continue; - - // 查找目标对象中的对应字段 - var targetField = typeof(WXEditorScriptObject).GetField( - sourceField.Name, - System.Reflection.BindingFlags.Public | - System.Reflection.BindingFlags.Instance | - System.Reflection.BindingFlags.NonPublic); - - // if (targetField != null && !targetField.FieldType.IsValueType && !targetField.FieldType.IsEnum) - // { - // // // 复制字段值 - // // var value = sourceField.GetValue(source); - // // targetField.SetValue(newTarget, value); - // // 递归复制子对象属性 - // var subObj = targetField.GetValue(newTarget) ?? Activator.CreateInstance(targetField.FieldType); - // CopySubObjectProperties(value, subObj); - // targetField.SetValue(newTarget, subObj); - // } - - // if (targetField != null && - // (targetField.FieldType.IsAssignableFrom(sourceField.FieldType) || - // (targetField.FieldType.IsValueType && sourceField.FieldType.IsValueType && - // targetField.FieldType == sourceField.FieldType))) - // { - // 复制字段值 - var value = sourceField.GetValue(source); - // 特殊处理嵌套对象类型的字段 - if (value != null && !targetField.FieldType.IsValueType && !targetField.FieldType.IsEnum) - { - // 递归复制子对象属性 - var subObj = targetField.GetValue(newTarget) ?? Activator.CreateInstance(targetField.FieldType); - CopySubObjectProperties(value, subObj); - targetField.SetValue(newTarget, subObj); - } - else - { - targetField.SetValue(newTarget, value); - } - // } - } - - // 应用修改到序列化对象 - so.ApplyModifiedProperties(); - return newTarget; - } - - private static void CopySubObjectProperties(object source, object target) - { - var sourceType = source.GetType(); - var targetType = target.GetType(); - - foreach (var sourceField in sourceType.GetFields( - System.Reflection.BindingFlags.Public | - System.Reflection.BindingFlags.Instance | - System.Reflection.BindingFlags.NonPublic)) + public static WXConvertCore.WXExportError DoExport(bool buildWebGL = true) { - if (sourceField.IsInitOnly) continue; + WXConvertCore.isPlayableBuild = true; + // var preCheckResult = WXConvertCore.PreCheck(); + // if (preCheckResult != WXConvertCore.WXExportError.SUCCEED) + // { + // WXConvertCore.isPlayableBuild = false; + // return preCheckResult; + // } + // WXConvertCore.PreInit(); + var exportResult = WXConvertCore.DoExport(); - var targetField = targetType.GetField( - sourceField.Name, + WXConvertCore.isPlayableBuild = false; + return exportResult; + } + + public static WXEditorScriptObject GetFakeScriptObject() + { + return SetDefaultProperties(ConvertPlayableConfigToCommon(config)); + } + + public static WXEditorScriptObject ConvertPlayableConfigToCommon( + WXPlayableEditorScriptObject source, + WXEditorScriptObject target = null) + { + // 创建或使用现有的目标实例 + var newTarget = target ?? ScriptableObject.CreateInstance(); + + // 使用序列化方式深度拷贝公共字段 + var so = new SerializedObject(newTarget); + + // 遍历源对象的所有字段 + var sourceType = source.GetType(); + foreach (var sourceField in sourceType.GetFields( System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance | - System.Reflection.BindingFlags.NonPublic); - - if (targetField != null && - (targetField.FieldType.IsAssignableFrom(sourceField.FieldType) || - (targetField.FieldType.IsValueType && sourceField.FieldType.IsValueType && - targetField.FieldType == sourceField.FieldType))) + System.Reflection.BindingFlags.NonPublic)) { + // 跳过readonly字段 + if (sourceField.IsInitOnly) continue; + + // 查找目标对象中的对应字段 + var targetField = typeof(WXEditorScriptObject).GetField( + sourceField.Name, + System.Reflection.BindingFlags.Public | + System.Reflection.BindingFlags.Instance | + System.Reflection.BindingFlags.NonPublic); + + // if (targetField != null && !targetField.FieldType.IsValueType && !targetField.FieldType.IsEnum) + // { + // // // 复制字段值 + // // var value = sourceField.GetValue(source); + // // targetField.SetValue(newTarget, value); + // // 递归复制子对象属性 + // var subObj = targetField.GetValue(newTarget) ?? Activator.CreateInstance(targetField.FieldType); + // CopySubObjectProperties(value, subObj); + // targetField.SetValue(newTarget, subObj); + // } + + // if (targetField != null && + // (targetField.FieldType.IsAssignableFrom(sourceField.FieldType) || + // (targetField.FieldType.IsValueType && sourceField.FieldType.IsValueType && + // targetField.FieldType == sourceField.FieldType))) + // { + // 复制字段值 var value = sourceField.GetValue(source); - targetField.SetValue(target, value); + // 特殊处理嵌套对象类型的字段 + if (value != null && !targetField.FieldType.IsValueType && !targetField.FieldType.IsEnum) + { + // 递归复制子对象属性 + var subObj = targetField.GetValue(newTarget) ?? Activator.CreateInstance(targetField.FieldType); + CopySubObjectProperties(value, subObj); + targetField.SetValue(newTarget, subObj); + } + else + { + targetField.SetValue(newTarget, value); + } + // } + } + + // 应用修改到序列化对象 + so.ApplyModifiedProperties(); + return newTarget; + } + + private static void CopySubObjectProperties(object source, object target) + { + var sourceType = source.GetType(); + var targetType = target.GetType(); + + foreach (var sourceField in sourceType.GetFields( + System.Reflection.BindingFlags.Public | + System.Reflection.BindingFlags.Instance | + System.Reflection.BindingFlags.NonPublic)) + { + if (sourceField.IsInitOnly) continue; + + var targetField = targetType.GetField( + sourceField.Name, + System.Reflection.BindingFlags.Public | + System.Reflection.BindingFlags.Instance | + System.Reflection.BindingFlags.NonPublic); + + if (targetField != null && + (targetField.FieldType.IsAssignableFrom(sourceField.FieldType) || + (targetField.FieldType.IsValueType && sourceField.FieldType.IsValueType && + targetField.FieldType == sourceField.FieldType))) + { + var value = sourceField.GetValue(source); + targetField.SetValue(target, value); + } } } - } - public static WXEditorScriptObject SetDefaultProperties(WXEditorScriptObject target) - { - target.ProjectConf.CDN = ""; - target.ProjectConf.assetLoadType = 1; - target.ProjectConf.compressDataPackage = true; + public static WXEditorScriptObject SetDefaultProperties(WXEditorScriptObject target) + { + target.ProjectConf.CDN = ""; + target.ProjectConf.assetLoadType = 1; + target.ProjectConf.compressDataPackage = true; - target.CompileOptions.showMonitorSuggestModal = false; - return target; + target.CompileOptions.showMonitorSuggestModal = false; + return target; + } } - } } \ No newline at end of file diff --git a/Editor/Playable/WXPlayableEditorSettingHelper.cs b/Editor/Playable/WXPlayableEditorSettingHelper.cs index 9c8db576e..390e64623 100644 --- a/Editor/Playable/WXPlayableEditorSettingHelper.cs +++ b/Editor/Playable/WXPlayableEditorSettingHelper.cs @@ -6,358 +6,354 @@ using UnityEngine; namespace WeChatWASM { - [InitializeOnLoad] - public class WXPlayableSettingsHelperInterface - { - public static WXPlayableSettingsHelper helper = new WXPlayableSettingsHelper(); - } - - public class WXPlayableSettingsHelper - { - public static string projectRootPath; - private static WXPlayableEditorScriptObject config; - private static bool m_EnablePerfTool = false; - - private static string _dstCache; - public static bool UseIL2CPP + [InitializeOnLoad] + public class WXPlayableSettingsHelperInterface { - get - { + public static WXPlayableSettingsHelper helper = new WXPlayableSettingsHelper(); + } + + public class WXPlayableSettingsHelper + { + public static string projectRootPath; + private static WXPlayableEditorScriptObject config; + private static bool m_EnablePerfTool = false; + public static bool UseIL2CPP + { + get + { #if TUANJIE_2022_3_OR_NEWER return PlayerSettings.GetScriptingBackend(BuildTargetGroup.WeixinMiniGame) == ScriptingImplementation.IL2CPP; #else - return true; + return true; #endif - } - } - - public WXPlayableSettingsHelper() - { - projectRootPath = System.IO.Path.GetFullPath(Application.dataPath + "/../"); - _dstCache = ""; - } - - public void OnFocus() - { - loadData(); - } - - public void OnLostFocus() - { - saveData(); - } - - public void OnDisable() - { - EditorUtility.SetDirty(config); - } - - private Vector2 scrollRoot; - private bool foldBaseInfo = true; - private bool foldDebugOptions = true; - public void OnSettingsGUI(EditorWindow window) - { - 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)); - this.formInput("appid", "小游戏试玩AppID"); - this.formInput("projectName", "小游戏试玩项目名"); - this.formIntPopup("orientation", "游戏方向", new[] { "Portrait", "Landscape" }, new[] { 0, 1, 2, 3 }); - this.formInput("memorySize", "UnityHeap预留内存(?)", "单位MB,预分配内存值,超休闲游戏256/中轻度496/重度游戏768,需预估游戏最大UnityHeap值以防止内存自动扩容带来的峰值尖刺。预估方法请查看GIT文档《优化Unity WebGL的内存》"); - - GUILayout.BeginHorizontal(); - string targetDst = "dst"; - if (!formInputData.ContainsKey(targetDst)) - { - formInputData[targetDst] = ""; + } } - EditorGUILayout.LabelField(string.Empty, GUILayout.Width(10)); - GUILayout.Label(new GUIContent("导出路径(?)", "支持输入相对于项目根目录的相对路径,如:wxbuild"), GUILayout.Width(140)); - formInputData[targetDst] = GUILayout.TextField(formInputData[targetDst], GUILayout.MaxWidth(EditorGUIUtility.currentViewWidth - 270)); - if (GUILayout.Button(new GUIContent("打开"), GUILayout.Width(40))) + + public WXPlayableSettingsHelper() { - if (!formInputData[targetDst].Trim().Equals(string.Empty)) - { - EditorUtility.RevealInFinder(GetAbsolutePath(formInputData[targetDst])); - } - GUIUtility.ExitGUI(); + projectRootPath = System.IO.Path.GetFullPath(Application.dataPath + "/../"); } - if (GUILayout.Button(new GUIContent("选择"), GUILayout.Width(40))) + + public void OnFocus() { - var dstPath = EditorUtility.SaveFolderPanel("选择你的游戏导出目录", string.Empty, string.Empty); - if (dstPath != string.Empty) - { - formInputData[targetDst] = dstPath; - this.saveData(); - } - GUIUtility.ExitGUI(); + loadData(); } - GUILayout.EndHorizontal(); - - EditorGUILayout.EndVertical(); - } - - foldDebugOptions = EditorGUILayout.Foldout(foldDebugOptions, "调试编译选项"); - if (foldDebugOptions) - { - EditorGUILayout.BeginVertical("frameBox", GUILayout.ExpandWidth(true)); - 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)"); - EditorGUILayout.EndVertical(); - } - - EditorGUILayout.EndScrollView(); - } - public void OnBuildButtonGUI(EditorWindow window) - { - 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; - EditorGUILayout.BeginHorizontal(); - EditorGUILayout.LabelField(string.Empty, GUILayout.MinWidth(10)); - if (GUILayout.Button(new GUIContent("生成并转换"), GUILayout.Width(100), GUILayout.Height(25))) - { - this.saveData(); - if (WXPlayableConvertCore.DoExport() == WXConvertCore.WXExportError.SUCCEED) + public void OnLostFocus() { - window.ShowNotification(new GUIContent("转换完成")); + saveData(); } - GUIUtility.ExitGUI(); - } - EditorGUILayout.EndHorizontal(); - } - private void OnDevelopmentBuildToggleChanged(bool InNewValue) - { - // 针对non-dev build,取消性能分析工具的集成 - if (!InNewValue) - { - this.setData("enablePerfAnalysis", false); - } - } - private string SDKFilePath; - - private void loadData() - { - SDKFilePath = Path.Combine(UnityUtil.GetWxSDKRootPath(), "Runtime", "wechat-playable-default", "unity-sdk", "index.js"); - config = UnityUtil.GetPlayableEditorConf(); - _dstCache = config.ProjectConf.DST; - - this.setData("projectName", config.ProjectConf.projectName); - this.setData("appid", config.ProjectConf.Appid); - this.setData("orientation", (int)config.ProjectConf.Orientation); - this.setData("dst", _dstCache); - - this.setData("developBuild", config.CompileOptions.DevelopBuild); - this.setData("il2CppOptimizeSize", config.CompileOptions.Il2CppOptimizeSize); - this.setData("profilingFuncs", config.CompileOptions.profilingFuncs); - this.setData("webgl2", config.CompileOptions.Webgl2); - this.setData("customNodePath", config.CompileOptions.CustomNodePath); - - this.setData("memorySize", config.ProjectConf.MemorySize.ToString()); - } - - private void saveData() - { - config.ProjectConf.projectName = this.getDataInput("projectName"); - config.ProjectConf.Appid = this.getDataInput("appid"); - config.ProjectConf.Orientation = (WXScreenOritation)this.getDataPop("orientation"); - _dstCache = this.getDataInput("dst"); - config.ProjectConf.DST = GetAbsolutePath(_dstCache); - - config.CompileOptions.DevelopBuild = this.getDataCheckbox("developBuild"); - config.CompileOptions.Il2CppOptimizeSize = this.getDataCheckbox("il2CppOptimizeSize"); - config.CompileOptions.profilingFuncs = this.getDataCheckbox("profilingFuncs"); - config.CompileOptions.CustomNodePath = this.getDataInput("customNodePath"); - config.CompileOptions.Webgl2 = this.getDataCheckbox("webgl2"); - config.ProjectConf.MemorySize = int.Parse(this.getDataInput("memorySize")); - } - - private Dictionary formInputData = new Dictionary(); - private Dictionary formIntPopupData = new Dictionary(); - private Dictionary formCheckboxData = new Dictionary(); - - private string getDataInput(string target) - { - if (this.formInputData.ContainsKey(target)) - return this.formInputData[target]; - return ""; - } - - private int getDataPop(string target) - { - if (this.formIntPopupData.ContainsKey(target)) - return this.formIntPopupData[target]; - return 0; - } - - private bool getDataCheckbox(string target) - { - if (this.formCheckboxData.ContainsKey(target)) - return this.formCheckboxData[target]; - return false; - } - - private void formCheckbox(string target, string label, string help = null, bool disable = false, Action setting = null, Action onValueChanged = 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); - - // Toggle the checkbox value based on the disable condition - bool newValue = EditorGUILayout.Toggle(disable ? false : formCheckboxData[target]); - // Update the checkbox data if the value has changed and invoke the onValueChanged action - if (newValue != formCheckboxData[target]) - { - formCheckboxData[target] = newValue; - onValueChanged?.Invoke(newValue); - } - - if (setting != null) - { - EditorGUILayout.LabelField("", GUILayout.Width(10)); - // 配置按钮 - if (GUILayout.Button(new GUIContent("设置"), GUILayout.Width(40), GUILayout.Height(18))) + public void OnDisable() { - setting?.Invoke(true); + EditorUtility.SetDirty(config); } - EditorGUILayout.LabelField("", GUILayout.MinWidth(10)); - } - EditorGUI.EndDisabledGroup(); + private Vector2 scrollRoot; + private bool foldBaseInfo = true; + private bool foldDebugOptions = true; + public void OnSettingsGUI(EditorWindow window) + { + 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; - if (setting == null) - EditorGUILayout.LabelField(string.Empty); - GUILayout.EndHorizontal(); + foldBaseInfo = EditorGUILayout.Foldout(foldBaseInfo, "基本信息"); + if (foldBaseInfo) + { + EditorGUILayout.BeginVertical("frameBox", GUILayout.ExpandWidth(true)); + this.formInput("appid", "小游戏试玩AppID"); + this.formInput("projectName", "小游戏试玩项目名"); + this.formIntPopup("orientation", "游戏方向", new[] { "Portrait", "Landscape" }, new[] { 0, 1, 2, 3 }); + this.formInput("memorySize", "UnityHeap预留内存(?)", "单位MB,预分配内存值,超休闲游戏256/中轻度496/重度游戏768,需预估游戏最大UnityHeap值以防止内存自动扩容带来的峰值尖刺。预估方法请查看GIT文档《优化Unity WebGL的内存》"); + + GUILayout.BeginHorizontal(); + string targetDst = "dst"; + if (!formInputData.ContainsKey(targetDst)) + { + formInputData[targetDst] = ""; + } + EditorGUILayout.LabelField(string.Empty, GUILayout.Width(10)); + GUILayout.Label(new GUIContent("导出路径(?)", "支持输入相对于项目根目录的相对路径,如:wxbuild"), GUILayout.Width(140)); + formInputData[targetDst] = GUILayout.TextField(formInputData[targetDst], GUILayout.MaxWidth(EditorGUIUtility.currentViewWidth - 270)); + if (GUILayout.Button(new GUIContent("打开"), GUILayout.Width(40))) + { + if (!formInputData[targetDst].Trim().Equals(string.Empty)) + { + EditorUtility.RevealInFinder(GetAbsolutePath(formInputData[targetDst])); + } + GUIUtility.ExitGUI(); + } + if (GUILayout.Button(new GUIContent("选择"), GUILayout.Width(40))) + { + var dstPath = EditorUtility.SaveFolderPanel("选择你的游戏导出目录", string.Empty, string.Empty); + if (dstPath != string.Empty) + { + formInputData[targetDst] = dstPath; + this.saveData(); + } + GUIUtility.ExitGUI(); + } + GUILayout.EndHorizontal(); + + + EditorGUILayout.EndVertical(); + } + + foldDebugOptions = EditorGUILayout.Foldout(foldDebugOptions, "调试编译选项"); + if (foldDebugOptions) + { + EditorGUILayout.BeginVertical("frameBox", GUILayout.ExpandWidth(true)); + 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)"); + EditorGUILayout.EndVertical(); + } + + EditorGUILayout.EndScrollView(); + } + public void OnBuildButtonGUI(EditorWindow window) + { + 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; + EditorGUILayout.BeginHorizontal(); + EditorGUILayout.LabelField(string.Empty, GUILayout.MinWidth(10)); + if (GUILayout.Button(new GUIContent("生成并转换"), GUILayout.Width(100), GUILayout.Height(25))) + { + this.saveData(); + if (WXPlayableConvertCore.DoExport() == WXConvertCore.WXExportError.SUCCEED) + { + window.ShowNotification(new GUIContent("转换完成")); + } + GUIUtility.ExitGUI(); + } + EditorGUILayout.EndHorizontal(); + } + private void OnDevelopmentBuildToggleChanged(bool InNewValue) + { + // 针对non-dev build,取消性能分析工具的集成 + if (!InNewValue) + { + this.setData("enablePerfAnalysis", false); + } + } + + private string SDKFilePath; + + private void loadData() + { + SDKFilePath = Path.Combine(UnityUtil.GetWxSDKRootPath(), "Runtime", "wechat-playable-default", "unity-sdk", "index.js"); + config = UnityUtil.GetPlayableEditorConf(); + + this.setData("projectName", config.ProjectConf.projectName); + this.setData("appid", config.ProjectConf.Appid); + this.setData("orientation", (int)config.ProjectConf.Orientation); + this.setData("dst", config.ProjectConf.relativeDST); + + this.setData("developBuild", config.CompileOptions.DevelopBuild); + this.setData("il2CppOptimizeSize", config.CompileOptions.Il2CppOptimizeSize); + this.setData("profilingFuncs", config.CompileOptions.profilingFuncs); + this.setData("webgl2", config.CompileOptions.Webgl2); + this.setData("customNodePath", config.CompileOptions.CustomNodePath); + + this.setData("memorySize", config.ProjectConf.MemorySize.ToString()); + } + + private void saveData() + { + config.ProjectConf.projectName = this.getDataInput("projectName"); + config.ProjectConf.Appid = this.getDataInput("appid"); + config.ProjectConf.Orientation = (WXScreenOritation)this.getDataPop("orientation"); + config.ProjectConf.relativeDST = this.getDataInput("dst"); + config.ProjectConf.DST = GetAbsolutePath(config.ProjectConf.relativeDST); + + config.CompileOptions.DevelopBuild = this.getDataCheckbox("developBuild"); + config.CompileOptions.Il2CppOptimizeSize = this.getDataCheckbox("il2CppOptimizeSize"); + config.CompileOptions.profilingFuncs = this.getDataCheckbox("profilingFuncs"); + config.CompileOptions.CustomNodePath = this.getDataInput("customNodePath"); + config.CompileOptions.Webgl2 = this.getDataCheckbox("webgl2"); + config.ProjectConf.MemorySize = int.Parse(this.getDataInput("memorySize")); + } + + private Dictionary formInputData = new Dictionary(); + private Dictionary formIntPopupData = new Dictionary(); + private Dictionary formCheckboxData = new Dictionary(); + + private string getDataInput(string target) + { + if (this.formInputData.ContainsKey(target)) + return this.formInputData[target]; + return ""; + } + + private int getDataPop(string target) + { + if (this.formIntPopupData.ContainsKey(target)) + return this.formIntPopupData[target]; + return 0; + } + + private bool getDataCheckbox(string target) + { + if (this.formCheckboxData.ContainsKey(target)) + return this.formCheckboxData[target]; + return false; + } + + private void formCheckbox(string target, string label, string help = null, bool disable = false, Action setting = null, Action onValueChanged = 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); + + // Toggle the checkbox value based on the disable condition + bool newValue = EditorGUILayout.Toggle(disable ? false : formCheckboxData[target]); + // Update the checkbox data if the value has changed and invoke the onValueChanged action + if (newValue != formCheckboxData[target]) + { + formCheckboxData[target] = newValue; + onValueChanged?.Invoke(newValue); + } + + 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 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 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; + } + + return Path.Combine(projectRootPath, path); + } } - - 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 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; - } - - return Path.Combine(projectRootPath, path); - } - } } \ No newline at end of file diff --git a/Editor/WXConvertCore.cs b/Editor/WXConvertCore.cs index 2c76b9327..d8a527f35 100644 --- a/Editor/WXConvertCore.cs +++ b/Editor/WXConvertCore.cs @@ -99,6 +99,14 @@ namespace WeChatWASM #endif } } + // 是否使用 iOS Metal 渲染 + public static bool UseiOSMetal + { + get + { + return config.CompileOptions.enableiOSMetal; + } + } // public static void SetPlayableEnabled(bool enabled) // { // isPlayableBuild = enabled; @@ -112,9 +120,12 @@ namespace WeChatWASM CheckBuildTarget(); Init(); // 可能有顺序要求?如果没要求,可挪到此函数外 - if (!isPlayableBuild) { + if (!isPlayableBuild) + { ProcessWxPerfBinaries(); } + // iOS metal 的相关特性 + ProcessWxiOSMetalBinaries(); MakeEnvForLuaAdaptor(); // JSLib SettingWXTextureMinJSLib(); @@ -140,7 +151,7 @@ namespace WeChatWASM return WXExportError.BUILD_WEBGL_FAILED; } dynamic config = isPlayableBuild ? UnityUtil.GetPlayableEditorConf() : UnityUtil.GetEditorConf(); - if (config.ProjectConf.DST == string.Empty) + if (config.ProjectConf.relativeDST == string.Empty) { Debug.LogError("请先配置游戏导出路径"); return WXExportError.BUILD_WEBGL_FAILED; @@ -400,6 +411,41 @@ namespace WeChatWASM return true; } + private static void ProcessWxiOSMetalBinaries() + { + string[] glLibs; + string DS = WXAssetsTextTools.DS; + if (UnityUtil.GetSDKMode() == UnityUtil.SDKMode.Package) + { + glLibs = new string[] + { + $"Packages{DS}com.qq.weixin.minigame{DS}Editor{DS}BuildProfile{DS}lib{DS}libwx-metal-cpp.bc", + $"Packages{DS}com.qq.weixin.minigame{DS}Editor{DS}BuildProfile{DS}lib{DS}mtl_library.jslib", + }; + } + else + { + string glLibRootDir = $"Assets{DS}WX-WASM-SDK-V2{DS}Editor{DS}BuildProfile{DS}lib{DS}"; + glLibs = new string[] + { + $"{glLibRootDir}libwx-metal-cpp.bc", + $"{glLibRootDir}mtl_library.jslib", + }; + } + for (int i = 0; i < glLibs.Length; i++) + { + var importer = AssetImporter.GetAtPath(glLibs[i]) as PluginImporter; +#if PLATFORM_WEIXINMINIGAME + importer.SetCompatibleWithPlatform(BuildTarget.WeixinMiniGame, config.CompileOptions.enableiOSMetal); +#else + importer.SetCompatibleWithPlatform(BuildTarget.WebGL, config.CompileOptions.enableiOSMetal); +#endif + // importer.SaveAndReimport(); + SetPluginCompatibilityByModifyingMetadataFile(glLibs[i], config.CompileOptions.enableiOSMetal); + } + AssetDatabase.Refresh(); + } + private static string GetLuaAdaptorPath(string filename) { string DS = WXAssetsTextTools.DS; @@ -523,13 +569,28 @@ namespace WeChatWASM GraphicsDeviceType[] targets = new GraphicsDeviceType[] { }; #if PLATFORM_WEIXINMINIGAME PlayerSettings.SetUseDefaultGraphicsAPIs(BuildTarget.WeixinMiniGame, false); - if (config.CompileOptions.Webgl2) + // 启用 iOS Metal 渲染 + if (UseiOSMetal) { - PlayerSettings.SetGraphicsAPIs(BuildTarget.WeixinMiniGame, new GraphicsDeviceType[] { GraphicsDeviceType.OpenGLES3 }); + if (config.CompileOptions.Webgl2) + { + PlayerSettings.SetGraphicsAPIs(BuildTarget.WeixinMiniGame, new GraphicsDeviceType[] { GraphicsDeviceType.Metal, GraphicsDeviceType.OpenGLES3 }); + } + else + { + PlayerSettings.SetGraphicsAPIs(BuildTarget.WeixinMiniGame, new GraphicsDeviceType[] { GraphicsDeviceType.Metal, GraphicsDeviceType.OpenGLES2 }); + } } - else + else { - PlayerSettings.SetGraphicsAPIs(BuildTarget.WeixinMiniGame, new GraphicsDeviceType[] { GraphicsDeviceType.OpenGLES2 }); + if (config.CompileOptions.Webgl2) + { + PlayerSettings.SetGraphicsAPIs(BuildTarget.WeixinMiniGame, new GraphicsDeviceType[] { GraphicsDeviceType.OpenGLES3 }); + } + else + { + PlayerSettings.SetGraphicsAPIs(BuildTarget.WeixinMiniGame, new GraphicsDeviceType[] { GraphicsDeviceType.OpenGLES2 }); + } } #else PlayerSettings.SetUseDefaultGraphicsAPIs(BuildTarget.WebGL, false); @@ -819,6 +880,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! "); @@ -1194,7 +1271,8 @@ namespace WeChatWASM public static void convertDataPackageJS() { - if (!isPlayableBuild) { + if (!isPlayableBuild) + { checkNeedRmovePackageParallelPreload(); } @@ -1649,7 +1727,8 @@ namespace WeChatWASM content = content.Replace("$unityVersion$", Application.unityVersion); File.WriteAllText(Path.Combine(dst, "unity-sdk", "index.js"), content, Encoding.UTF8); // content = File.ReadAllText(Path.Combine(Application.dataPath, "WX-WASM-SDK-V2", "Runtime", "wechat-default", "unity-sdk", "storage.js"), Encoding.UTF8); - if (!isPlayableBuild) { + if (!isPlayableBuild) + { content = File.ReadAllText(Path.Combine(UnityUtil.GetWxSDKRootPath(), "Runtime", defaultTemplateDir, "unity-sdk", "storage.js"), Encoding.UTF8); var PreLoadKeys = config.PlayerPrefsKeys.Count > 0 ? JsonMapper.ToJson(config.PlayerPrefsKeys) : "[]"; content = content.Replace("'$PreLoadKeys'", PreLoadKeys); @@ -1903,7 +1982,7 @@ namespace WeChatWASM config.ProjectConf.bundleHashLength.ToString(), bundlePathIdentifierStr, excludeFileExtensionsStr, - config.CompileOptions.Webgl2 ? "2" : "1", + config.CompileOptions.enableiOSMetal ? "5" : (config.CompileOptions.Webgl2 ? "2" : "1"), Application.unityVersion, WXExtEnvDef.pluginVersion, config.ProjectConf.dataFileSubPrefix, @@ -1951,11 +2030,14 @@ namespace WeChatWASM config.CompileOptions.enablePerfAnalysis ? "true" : "false", config.ProjectConf.MemorySize.ToString(), config.SDKOptions.disableMultiTouch ? "true" : "false", + // Perfstream,暂时设为false + "false" }); List replaceList = new List(replaceArrayList); List files = new List { "game.js", "game.json", "project.config.json", "unity-namespace.js", "check-version.js", "unity-sdk/font/index.js" }; - if (isPlayableBuild) { + if (isPlayableBuild) + { files = new List { "game.js", "game.json", "project.config.json", "unity-namespace.js", "check-version.js" }; } diff --git a/Editor/WXEditorSettingHelper.cs b/Editor/WXEditorSettingHelper.cs index 3eed3e3fa..8fd180662 100644 --- a/Editor/WXEditorSettingHelper.cs +++ b/Editor/WXEditorSettingHelper.cs @@ -54,15 +54,11 @@ namespace WeChatWASM foldInstantGame = WXConvertCore.IsInstantGameAutoStreaming(); projectRootPath = System.IO.Path.GetFullPath(Application.dataPath + "/../"); - - _dstCache = ""; } private static WXEditorScriptObject config; private static bool m_EnablePerfTool = false; - private static string _dstCache; - public void OnFocus() { loadData(); @@ -187,8 +183,9 @@ 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"); + this.formCheckbox("webgl2", "WebGL2.0(beta)"); this.formCheckbox("iOSPerformancePlus", "iOSPerformancePlus(?)", "是否使用iOS高性能+渲染方案,有助于提升渲染兼容性、降低WebContent进程内存"); + // 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"); @@ -394,7 +391,6 @@ namespace WeChatWASM // SDKFilePath = Path.Combine(Application.dataPath, "WX-WASM-SDK-V2", "Runtime", "wechat-default", "unity-sdk", "index.js"); SDKFilePath = Path.Combine(UnityUtil.GetWxSDKRootPath(), "Runtime", "wechat-default", "unity-sdk", "index.js"); config = UnityUtil.GetEditorConf(); - _dstCache = config.ProjectConf.DST; // Instant Game if (WXConvertCore.IsInstantGameAutoStreaming()) @@ -436,7 +432,7 @@ namespace WeChatWASM this.setData("compressDataPackage", config.ProjectConf.compressDataPackage); this.setData("videoUrl", config.ProjectConf.VideoUrl); this.setData("orientation", (int)config.ProjectConf.Orientation); - this.setData("dst", _dstCache); + this.setData("dst", config.ProjectConf.relativeDST); this.setData("bundleHashLength", config.ProjectConf.bundleHashLength.ToString()); this.setData("bundlePathIdentifier", config.ProjectConf.bundlePathIdentifier); this.setData("bundleExcludeExtensions", config.ProjectConf.bundleExcludeExtensions); @@ -452,6 +448,7 @@ namespace WeChatWASM this.setData("customNodePath", config.CompileOptions.CustomNodePath); this.setData("webgl2", config.CompileOptions.Webgl2); this.setData("iOSPerformancePlus", config.CompileOptions.enableIOSPerformancePlus); + this.setData("iOSMetal", config.CompileOptions.enableiOSMetal); this.setData("fbslim", config.CompileOptions.fbslim); this.setData("useFriendRelation", config.SDKOptions.UseFriendRelation); this.setData("useMiniGameChat", config.SDKOptions.UseMiniGameChat); @@ -513,8 +510,8 @@ namespace WeChatWASM config.ProjectConf.compressDataPackage = this.getDataCheckbox("compressDataPackage"); config.ProjectConf.VideoUrl = this.getDataInput("videoUrl"); config.ProjectConf.Orientation = (WXScreenOritation)this.getDataPop("orientation"); - _dstCache = this.getDataInput("dst"); - config.ProjectConf.DST = GetAbsolutePath(_dstCache); + config.ProjectConf.relativeDST = this.getDataInput("dst"); + config.ProjectConf.DST = GetAbsolutePath(config.ProjectConf.relativeDST); config.ProjectConf.bundleHashLength = int.Parse(this.getDataInput("bundleHashLength")); config.ProjectConf.bundlePathIdentifier = this.getDataInput("bundlePathIdentifier"); config.ProjectConf.bundleExcludeExtensions = this.getDataInput("bundleExcludeExtensions"); @@ -530,6 +527,7 @@ namespace WeChatWASM config.CompileOptions.CustomNodePath = this.getDataInput("customNodePath"); config.CompileOptions.Webgl2 = this.getDataCheckbox("webgl2"); config.CompileOptions.enableIOSPerformancePlus = this.getDataCheckbox("iOSPerformancePlus"); + config.CompileOptions.enableiOSMetal = this.getDataCheckbox("iOSMetal"); 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 3763d7e74..08a5888e4 100644 --- a/Editor/WXExtDef.cs +++ b/Editor/WXExtDef.cs @@ -125,6 +125,10 @@ namespace WeChatWASM { return WXConvertCore.UseIL2CPP; }); + WXExtEnvDef.RegisterAction("WXConvertCore.UseiOSMetal", (args) => + { + return WXConvertCore.UseiOSMetal; + }); WXExtEnvDef.RegisterAction("UnityUtil.GetWxSDKRootPath", (args) => { #if UNITY_2018 diff --git a/Editor/WXPluginVersion.cs b/Editor/WXPluginVersion.cs index 786ec751c..e82156b90 100644 --- a/Editor/WXPluginVersion.cs +++ b/Editor/WXPluginVersion.cs @@ -2,7 +2,7 @@ namespace WeChatWASM { public class WXPluginVersion { - public static string pluginVersion = "202507230322"; // 这一行不要改他,导出的时候会自动替换 + public static string pluginVersion = "202508040822"; // 这一行不要改他,导出的时候会自动替换 } public class WXPluginConf diff --git a/Editor/wx-editor.dll b/Editor/wx-editor.dll index 319c1f9f8..5e7df8077 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 05b31bf33..8bd12eb5f 100644 --- a/Editor/wx-editor.xml +++ b/Editor/wx-editor.xml @@ -381,6 +381,11 @@ 视频url + + + 导出路径(相对路径) + + 导出路径(绝对路径) @@ -643,6 +648,11 @@ 是否使用iOS高性能Plus + + + 是否使用iOS metal指令流 + + 是否使用brotli多线程压缩 @@ -773,6 +783,11 @@ 试玩 appid + + + 导出路径(相对路径) + + 导出路径(绝对路径) diff --git a/Editor/wx-editor.xml.meta b/Editor/wx-editor.xml.meta index 17dea8b90..9076a7dd3 100644 --- a/Editor/wx-editor.xml.meta +++ b/Editor/wx-editor.xml.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4a90389cebd5db8b1ab58b0a3ca5cdc8 +guid: d05761f316f7eab715c19190699cc137 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/Plugins/SDK-Call-JS-Old.jslib b/Runtime/Plugins/SDK-Call-JS-Old.jslib index 6d658038c..09d9ec303 100755 --- a/Runtime/Plugins/SDK-Call-JS-Old.jslib +++ b/Runtime/Plugins/SDK-Call-JS-Old.jslib @@ -416,11 +416,11 @@ mergeInto(LibraryManager.library, { WXVideoPlay: function(id) { window.WXWASMSDK.WXVideoPlay(_WXPointer_stringify_adaptor(id)); }, - WXVideoAddListener: function(id,key) { + WXVideoAddListener: function(id, key) { window.WXWASMSDK.WXVideoAddListener(_WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(key)); }, - WXVideoDestroy: function(id) { - window.WXWASMSDK.WXVideoDestroy(_WXPointer_stringify_adaptor(id)); + WXVideoDestroy: function(id, isLast) { + window.WXWASMSDK.WXVideoDestroy(_WXPointer_stringify_adaptor(id), isLast); }, WXVideoExitFullScreen: function(id) { window.WXWASMSDK.WXVideoExitFullScreen(_WXPointer_stringify_adaptor(id)); diff --git a/Runtime/Plugins/SDK-Call-JS.jslib b/Runtime/Plugins/SDK-Call-JS.jslib index 3256e5b87..7c5f0a0bb 100644 --- a/Runtime/Plugins/SDK-Call-JS.jslib +++ b/Runtime/Plugins/SDK-Call-JS.jslib @@ -115,8 +115,8 @@ WX_SyncFunction_tnn: function(functionName, returnType, param1, param2){ stringToUTF8((res || ''), buffer, bufferSize); return buffer; }, -WX_ClassOneWayFunction:function(functionName, returnType, successType, failType, completeType, conf) { - var res = window.WXWASMSDK.WX_ClassOneWayFunction(_WXPointer_stringify_adaptor(functionName), _WXPointer_stringify_adaptor(returnType), _WXPointer_stringify_adaptor(successType), _WXPointer_stringify_adaptor(failType), _WXPointer_stringify_adaptor(completeType), _WXPointer_stringify_adaptor(conf)); +WX_ClassConstructor:function(functionName, returnType, successType, failType, completeType, conf) { + var res = window.WXWASMSDK.WX_ClassConstructor(_WXPointer_stringify_adaptor(functionName), _WXPointer_stringify_adaptor(returnType), _WXPointer_stringify_adaptor(successType), _WXPointer_stringify_adaptor(failType), _WXPointer_stringify_adaptor(completeType), _WXPointer_stringify_adaptor(conf)); var bufferSize = lengthBytesUTF8(res || '') + 1; var buffer = _malloc(bufferSize); stringToUTF8((res || ''), buffer, bufferSize); @@ -156,5 +156,7 @@ WX_ClassOneWayNoFunction_vt: function(className, functionName, id, param1) { }, WX_ClassOneWayNoFunction_vn: function(className, functionName, id, param1) { window.WXWASMSDK.WX_ClassOneWayNoFunction_vs(_WXPointer_stringify_adaptor(className), _WXPointer_stringify_adaptor(functionName), _WXPointer_stringify_adaptor(id), param1); +},WX_ClassOneWayFunction: function(className, id, functionName, successType, failType, completeType, conf, callbackId, usePromise) { + window.WXWASMSDK.WX_ClassOneWayFunction(_WXPointer_stringify_adaptor(className), _WXPointer_stringify_adaptor(id), _WXPointer_stringify_adaptor(functionName), _WXPointer_stringify_adaptor(successType), _WXPointer_stringify_adaptor(failType), _WXPointer_stringify_adaptor(completeType), _WXPointer_stringify_adaptor(conf), _WXPointer_stringify_adaptor(callbackId), usePromise); }, }) \ No newline at end of file diff --git a/Runtime/Plugins/WxGameDataMonitor.jslib b/Runtime/Plugins/WxGameDataMonitor.jslib new file mode 100644 index 000000000..f9b504c7f --- /dev/null +++ b/Runtime/Plugins/WxGameDataMonitor.jslib @@ -0,0 +1,55 @@ +mergeInto(LibraryManager.library, { + JSStartGameDataMonitor: function() { + console.log("call JSStartGameDataMonitor \n"); + + if (typeof GameGlobal.manager.getGameDataMonitor === 'function') + { + GameGlobal.manager.getGameDataMonitor().start(); + } + else + { + console.log("GameGlobal.manager.getGameDataMonitor is not a function \n"); + } + }, + JSReportUnityProfileData: function( + targetFrameRate, // fps. + monoHeapReserved, monoHeapUsed, nativeReserved, nativeUnused, nativeAllocated, // profiler. + setPassCalls, drawCalls, vertices, trianglesCount // render. + ) { + console.log("call JSReportUnityProfileData \n"); + let report_data = { + timestamp: new Date().getTime(), + fps: { + targetFrameRate: targetFrameRate, + avgEXFrameTime: _WXGetEXFrameTime(), + }, + profiler: { + monoHeapReserved: monoHeapReserved, + monoHeapUsed: monoHeapUsed, + nativeReserved: nativeReserved, + nativeUnused: nativeUnused, + nativeAllocated: nativeAllocated, + }, + render: { + setPassCalls: setPassCalls, + drawCalls: drawCalls, + vertices: vertices, + trianglesCount: trianglesCount, + }, + webassembly: { + totalHeapMemory: _WXGetTotalMemorySize(), + dynamicMemory: _WXGetDynamicMemorySize(), + usedHeapMemory: _WXGetUsedMemorySize(), + unAllocatedMemory: _WXGetUnAllocatedMemorySize(), + }, + assetbundle: { + numberInMemory: _WXGetBundleNumberInMemory(), + numberOnDisk: _WXGetBundleNumberOnDisk(), + sizeInMemory: _WXGetBundleSizeInMemory(), + sizeOnDisk: _WXGetBundleSizeOnDisk(), + } + } + + GameGlobal.manager.getGameDataMonitor().reportUnityProfileData(report_data) + }, +}); \ No newline at end of file diff --git a/Runtime/Plugins/WxGameDataMonitor.jslib.meta b/Runtime/Plugins/WxGameDataMonitor.jslib.meta new file mode 100644 index 000000000..a0a033d4b --- /dev/null +++ b/Runtime/Plugins/WxGameDataMonitor.jslib.meta @@ -0,0 +1,79 @@ +fileFormatVersion: 2 +guid: 63a9d4fa9c3846e3704029822b94973f +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + : Any + second: + enabled: 0 + settings: + Exclude Editor: 1 + Exclude Linux64: 1 + Exclude OSXUniversal: 1 + Exclude WeixinMiniGame: 1 + Exclude Win: 1 + Exclude Win64: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Facebook: WebGL + second: + enabled: 0 + settings: {} + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: x86 + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: x86_64 + - first: + WebGL: WebGL + second: + enabled: 1 + settings: {} + - first: + WeixinMiniGame: WeixinMiniGame + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Runtime/Plugins/wx-perf.dll b/Runtime/Plugins/wx-perf.dll index 467d744c3..fb1264a0a 100644 Binary files a/Runtime/Plugins/wx-perf.dll and b/Runtime/Plugins/wx-perf.dll differ diff --git a/Runtime/Plugins/wx-runtime-editor.dll b/Runtime/Plugins/wx-runtime-editor.dll index 26d8f6e99..94f3cf33c 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 ccaca068c..55be65527 100644 --- a/Runtime/Plugins/wx-runtime-editor.xml +++ b/Runtime/Plugins/wx-runtime-editor.xml @@ -1699,26 +1699,6 @@ 如果返回的是字符串,则数据在这个字段 - - - 文件的类型和存取的权限,对应 POSIX stat.st_mode - - - - - 文件大小,单位:B,对应 POSIX stat.st_size - - - - - 文件最近一次被存取或被执行的时间,UNIX 时间戳,对应 POSIX stat.st_atime - - - - - 文件最后一次被修改的时间,UNIX 时间戳,对应 POSIX stat.st_mtime - - 文件的路径 @@ -1769,116 +1749,126 @@ 视频的总时长,单位为秒 - - - 视频的左上角横坐标 - - - - - 视频的左上角纵坐标 - - - - - 视频的宽度 - - - - - 视频的高度 - - - + 视频的资源地址 - - - 视频的封面 - - - - - 视频的初始播放位置,单位为 s 秒 - - - - - 视频的播放速率,有效值有 0.5、0.8、1.0、1.25、1.5 - - - - - 视频是否为直播 - - - - - 视频的缩放模式 - - - - - 视频是否显示控件 - - - - - 是否显示视频底部进度条 - - - - - 是否显示控制栏的进度条 - - - - - 视频背景颜色 - - - + 视频是否自动播放 - + - 视频是否是否循环播放 + 视频背景颜色 - + - 视频是否禁音播放 + 视频是否显示控件 - - - 视频是否遵循系统静音开关设置(仅iOS) - - - - - 是否启用手势控制播放进度 - - - + 是否开启双击播放的手势 - + + + 是否启用手势控制播放进度 + + + + + 视频的高度 + + + + + 视频的初始播放位置,单位为 s 秒 + + + + + 视频是否为直播 + + + + + 视频是否是否循环播放 + + + + + 视频是否禁音播放 + + + + + 视频是否遵循系统静音开关设置(仅iOS) + + + + + 视频的缩放模式 + + + + + 视频的播放速率,有效值有 0.5、0.8、1.0、1.25、1.5 + + + + + 视频的封面 + + + 是否显示视频中央的播放按钮 - + + + 是否显示视频底部进度条 + + + + + 是否显示控制栏的进度条 + + + + + 视频的宽度 + + + + + 视频的左上角横坐标 + + + + + 视频的左上角纵坐标 + + + 视频是否显示在游戏画布之下 + + + 视频跳转后自动暂停播放 + + + + + 视频跳转原生页后自动暂停播放 + + 开发版 @@ -3129,19 +3119,172 @@  是否结束 - + - 接口调用结束的回调函数(调用成功、失败都会执行) + 从不同渠道获得的OPENLINK字符串 - + - 接口调用失败的回调函数 + 选填,部分活动、功能允许接收自定义query参数,请参阅渠道说明,默认可不填 - + - 接口调用成功的回调函数 + 从不同渠道获得的OPENLINK字符串 + + + + + 选填,部分活动、功能允许接收自定义query参数,请参阅渠道说明,默认可不填 + + + + 错误信息 + + | 错误码 | 错误信息 | 说明 | + | - | - | - | + | 1001 | | 参数错误 | + | -1 | | 支付失败 | + | -2 | | 支付取消 | + | -4 | | 风控拦截 | + | -5 | | 开通签约结果未知 | + | -15001 | | 参数错误,具体原因见err_msg | + | -15002 | | outTradeNo重复使用,请换新单号重试 | + | -15003 | | 系统错误 | + | -15004 | | currencyType错误,目前只能填CNY | + | -15005 | | 用户态签名signature错误 | + | -15006 | | 支付签名paySig错误 | + | -15007 | | session_key过期 | + | -15008 | | 二级商户进件未完成 | + | -15009 | | 代币未发布 | + | -15010 | | 道具productId未发布 | + | -15011 | | 现网版本的env只能是0,不能填1(沙盒环境) | + | -15012 | | 调用米大师失败导致关单,请换新单号重试 | + | -15013 | | goodsPrice道具价格错误 | + | -15014 | | 道具/代币发布未生效,禁止下单,大概10分钟后生效 | + | -15016 | | signData格式有问题 | + | -15017 | | 此商家涉嫌违规,收款功能已被限制,暂无法支付。商家可以登录微信商户平台/微信支付商家助手小程序查看原因和解决方案 | + | -15018 | | 代币或者道具productId审核不通过 | + | -15019 | | 调微信报商户受限,商家可以登录微信商户平台/微信支付商家助手小程序查看原因和解决方案 | + | -15020 | | 操作过快,请稍候再试 | + | -15021 | | 小程序被限频交易 | + + + 错误码 + + | 错误码 | 错误信息 | 说明 | + | - | - | - | + | 1001 | | 参数错误 | + | -1 | | 支付失败 | + | -2 | | 支付取消 | + | -4 | | 风控拦截 | + | -5 | | 开通签约结果未知 | + | -15001 | | 参数错误,具体原因见err_msg | + | -15002 | | outTradeNo重复使用,请换新单号重试 | + | -15003 | | 系统错误 | + | -15004 | | currencyType错误,目前只能填CNY | + | -15005 | | 用户态签名signature错误 | + | -15006 | | 支付签名paySig错误 | + | -15007 | | session_key过期 | + | -15008 | | 二级商户进件未完成 | + | -15009 | | 代币未发布 | + | -15010 | | 道具productId未发布 | + | -15011 | | 现网版本的env只能是0,不能填1(沙盒环境) | + | -15012 | | 调用米大师失败导致关单,请换新单号重试 | + | -15013 | | goodsPrice道具价格错误 | + | -15014 | | 道具/代币发布未生效,禁止下单,大概10分钟后生效 | + | -15016 | | signData格式有问题 | + | -15017 | | 此商家涉嫌违规,收款功能已被限制,暂无法支付。商家可以登录微信商户平台/微信支付商家助手小程序查看原因和解决方案 | + | -15018 | | 代币或者道具productId审核不通过 | + | -15019 | | 调微信报商户受限,商家可以登录微信商户平台/微信支付商家助手小程序查看原因和解决方案 | + | -15020 | | 操作过快,请稍候再试 | + | -15021 | | 小程序被限频交易 | + + + 错误码 + + + 错误信息 + + + 调用成功信息 + + + + 支付的类型, 不同的支付类型有各自额外要传的附加参数 + 可选值: + - 'short_series_goods': 道具直购; + - 'short_series_coin': 代币充值; + + + + + 支付签名, 详见[《签名详解》](https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/virtual-payment.html) + + + + + 具体支付参数见signData, 该参数需以string形式传递, 例如signData: '{"offerId":"123","buyQuantity":1,"env":0,"currencyType":"CNY","productId":"testproductId","goodsPrice":10,"outTradeNo":"xxxxxx","attach":"testdata"}' + + + + + 用户态签名, 详见[《签名详解》](https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/virtual-payment.html) + + + + + 内部预留字段,开发者无需关注 + + + + + 币种 + 可选值: + - 'CNY': 人民币; + + + + + 支付的类型,不同的支付类型有各自额外要传的附加参数。 + 可选值: + - 'game': 购买游戏币; + + + + + 在米大师侧申请的应用 id + + + + + 业务订单号,每个订单号只能使用一次,重复使用会失败。开发者需要确保该订单号在对应游戏下的唯一性,平台会尽可能校验该唯一性约束,但极端情况下可能会跳过对该约束的校验。要求32个字符内,只能是数字、大小写字母、符号_-|*组成,不能以下划线()开头。建议每次调用wx.requestMidasPayment都换新的outTradeNo。若没有传入,则平台会自动填充一个,并以下划线开头 + + + + + 购买数量。mode=game 时必填。购买数量。详见 [buyQuantity 限制说明](#buyquantity-限制说明)。 + + + + + 环境配置 + 可选值: + - 0: 米大师正式环境; + - 1: 米大师沙箱环境; + + + + + 申请接入时的平台,platform 与应用id有关。 + 可选值: + - 'android': android; + + + + + 分区 ID @@ -4138,26 +4281,6 @@ 取值为0/1,取值为0表示会把 `App`、`Page` 的生命周期函数和 `wx` 命名空间下的函数调用写入日志,取值为1则不会。默认值是 0 - - - 从不同渠道获得的OPENLINK字符串 - - - - - 选填,部分活动、功能允许接收自定义query参数,请参阅渠道说明,默认可不填 - - - - - 从不同渠道获得的OPENLINK字符串 - - - - - 选填,部分活动、功能允许接收自定义query参数,请参阅渠道说明,默认可不填 - - 是否有新版本 @@ -7098,55 +7221,6 @@ 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) - - - 币种 - 可选值: - - 'CNY': 人民币; - - - - - 支付的类型,不同的支付类型有各自额外要传的附加参数。 - 可选值: - - 'game': 购买游戏币; - - - - - 在米大师侧申请的应用 id - - - - - 业务订单号,每个订单号只能使用一次,重复使用会失败。开发者需要确保该订单号在对应游戏下的唯一性,平台会尽可能校验该唯一性约束,但极端情况下可能会跳过对该约束的校验。要求32个字符内,只能是数字、大小写字母、符号_-|*组成,不能以下划线()开头。建议每次调用wx.requestMidasPayment都换新的outTradeNo。若没有传入,则平台会自动填充一个,并以下划线开头 - - - - - 购买数量。mode=game 时必填。购买数量。详见 [buyQuantity 限制说明](#buyquantity-限制说明)。 - - - - - 环境配置 - 可选值: - - 0: 米大师正式环境; - - 1: 米大师沙箱环境; - - - - - 申请接入时的平台,platform 与应用id有关。 - 可选值: - - 'android': android; - - - - - 分区 ID - - 错误信息 @@ -8544,22 +8618,44 @@ 显示用户信息按钮 + + + 微信小游戏视频组件 + + + + + 视频实例字典 (内部使用,请不要访问) + + + + + 视频实例ID + + + + + 视频创建参数 + + + + + 创建视频实例 + + 实例ID + 创建参数 + + + + 初始化属性 + + 内部函数,请不要调用 - - - 视频的资源地址 - - - - - 视频的封面 - - 视频的左上角横坐标 @@ -8580,9 +8676,69 @@ 视频的高度 - + - Gets a value indicating whether 是否正在播放 + 视频的资源地址 + + + + + 视频的封面 + + + + + 是否为直播 + + + + + 当视频大小与 video 容器大小不一致时,视频的表现形式 + + + + + 是否显示默认播放控件(播放/暂停按钮、播放进度、时间) + + + + + 是否显示播放进度 + + + + + 在非全屏模式下,是否开启亮度和音量调节手势 + + + + + 视频的背景色 + + + + + 是否遵循系统静音开关 + + + + + 是否开启控制进度的手势 + + + + + 是否开启播放手势 + + + + + 是否显示视频中间的播放按钮 + + + + + 销毁当前实例 @@ -8590,44 +8746,31 @@ 播放视频 - + - 监听视频播放事件 + 暂停 - + - 取消监听视频播放事件,action 为空表示移除全部事件监听 + 停止视频 - + - 监听视频播放到末尾事件 + 视频跳转 + 视频跳转到指定位置,单位为 s 秒 - + - 取消监听视频播放到末尾事件 + 视频全屏 + 设置全屏时视频的方向 0: 正常竖向, 90: 屏幕逆时针90度 . -90: 屏幕顺时针90度 - + - 监听视频错误事件 - - - - - 取消监听视频错误事件,action 为空表示移除全部事件监听 - - - - - 监听视频暂停事件 - - - - - 取消监听视频暂停事件,action 为空表示移除全部事件监听 + 视频退出全屏 @@ -8640,36 +8783,45 @@ 取消监听视频由于需要缓冲下一帧而停止时触发,action 为空表示移除全部事件监听 - + - 销毁当前实例 + 监听视频下载(缓冲)事件 + + + + + + 取消监听视频下载(缓冲)事件 ,action 为空表示移除全部事件监听 - + - 视频退出全屏 + 监听视频播放事件 - + - 暂停 + 取消监听视频播放事件,action 为空表示移除全部事件监听 - + - 视频全屏 + 监听视频暂停事件 - 设置全屏时视频的方向 0: 正常竖向, 90: 屏幕逆时针90度 . -90: 屏幕顺时针90度 - + - 视频跳转 + 取消监听视频暂停事件,action 为空表示移除全部事件监听 - 视频跳转到指定位置,单位为 s 秒 - + - 停止视频 + 监听视频播放到末尾事件 + + + + + 取消监听视频播放到末尾事件 @@ -8683,15 +8835,14 @@ 取消监听视频播放进度更新事件,action 为空表示移除全部事件监听 - + - 监听视频下载(缓冲)事件 + 监听视频错误事件 - - + - 取消监听视频下载(缓冲)事件 ,action 为空表示移除全部事件监听 + 取消监听视频错误事件,action 为空表示移除全部事件监听 diff --git a/Runtime/Plugins/wx-runtime-editor.xml.meta b/Runtime/Plugins/wx-runtime-editor.xml.meta index f377905e6..c04304d56 100644 --- a/Runtime/Plugins/wx-runtime-editor.xml.meta +++ b/Runtime/Plugins/wx-runtime-editor.xml.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a18857814588f027fbba2af025670e61 +guid: 7a86865669cf8962db73b80475f73340 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/Plugins/wx-runtime.dll b/Runtime/Plugins/wx-runtime.dll index fa9e3951e..5211aad5f 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 a73f981c2..7cc734492 100644 --- a/Runtime/Plugins/wx-runtime.xml +++ b/Runtime/Plugins/wx-runtime.xml @@ -1705,26 +1705,6 @@ 如果返回的是字符串,则数据在这个字段 - - - 文件的类型和存取的权限,对应 POSIX stat.st_mode - - - - - 文件大小,单位:B,对应 POSIX stat.st_size - - - - - 文件最近一次被存取或被执行的时间,UNIX 时间戳,对应 POSIX stat.st_atime - - - - - 文件最后一次被修改的时间,UNIX 时间戳,对应 POSIX stat.st_mtime - - 文件的路径 @@ -1775,116 +1755,126 @@ 视频的总时长,单位为秒 - - - 视频的左上角横坐标 - - - - - 视频的左上角纵坐标 - - - - - 视频的宽度 - - - - - 视频的高度 - - - + 视频的资源地址 - - - 视频的封面 - - - - - 视频的初始播放位置,单位为 s 秒 - - - - - 视频的播放速率,有效值有 0.5、0.8、1.0、1.25、1.5 - - - - - 视频是否为直播 - - - - - 视频的缩放模式 - - - - - 视频是否显示控件 - - - - - 是否显示视频底部进度条 - - - - - 是否显示控制栏的进度条 - - - - - 视频背景颜色 - - - + 视频是否自动播放 - + - 视频是否是否循环播放 + 视频背景颜色 - + - 视频是否禁音播放 + 视频是否显示控件 - - - 视频是否遵循系统静音开关设置(仅iOS) - - - - - 是否启用手势控制播放进度 - - - + 是否开启双击播放的手势 - + + + 是否启用手势控制播放进度 + + + + + 视频的高度 + + + + + 视频的初始播放位置,单位为 s 秒 + + + + + 视频是否为直播 + + + + + 视频是否是否循环播放 + + + + + 视频是否禁音播放 + + + + + 视频是否遵循系统静音开关设置(仅iOS) + + + + + 视频的缩放模式 + + + + + 视频的播放速率,有效值有 0.5、0.8、1.0、1.25、1.5 + + + + + 视频的封面 + + + 是否显示视频中央的播放按钮 - + + + 是否显示视频底部进度条 + + + + + 是否显示控制栏的进度条 + + + + + 视频的宽度 + + + + + 视频的左上角横坐标 + + + + + 视频的左上角纵坐标 + + + 视频是否显示在游戏画布之下 + + + 视频跳转后自动暂停播放 + + + + + 视频跳转原生页后自动暂停播放 + + 开发版 @@ -3135,19 +3125,172 @@  是否结束 - + - 接口调用结束的回调函数(调用成功、失败都会执行) + 从不同渠道获得的OPENLINK字符串 - + - 接口调用失败的回调函数 + 选填,部分活动、功能允许接收自定义query参数,请参阅渠道说明,默认可不填 - + - 接口调用成功的回调函数 + 从不同渠道获得的OPENLINK字符串 + + + + + 选填,部分活动、功能允许接收自定义query参数,请参阅渠道说明,默认可不填 + + + + 错误信息 + + | 错误码 | 错误信息 | 说明 | + | - | - | - | + | 1001 | | 参数错误 | + | -1 | | 支付失败 | + | -2 | | 支付取消 | + | -4 | | 风控拦截 | + | -5 | | 开通签约结果未知 | + | -15001 | | 参数错误,具体原因见err_msg | + | -15002 | | outTradeNo重复使用,请换新单号重试 | + | -15003 | | 系统错误 | + | -15004 | | currencyType错误,目前只能填CNY | + | -15005 | | 用户态签名signature错误 | + | -15006 | | 支付签名paySig错误 | + | -15007 | | session_key过期 | + | -15008 | | 二级商户进件未完成 | + | -15009 | | 代币未发布 | + | -15010 | | 道具productId未发布 | + | -15011 | | 现网版本的env只能是0,不能填1(沙盒环境) | + | -15012 | | 调用米大师失败导致关单,请换新单号重试 | + | -15013 | | goodsPrice道具价格错误 | + | -15014 | | 道具/代币发布未生效,禁止下单,大概10分钟后生效 | + | -15016 | | signData格式有问题 | + | -15017 | | 此商家涉嫌违规,收款功能已被限制,暂无法支付。商家可以登录微信商户平台/微信支付商家助手小程序查看原因和解决方案 | + | -15018 | | 代币或者道具productId审核不通过 | + | -15019 | | 调微信报商户受限,商家可以登录微信商户平台/微信支付商家助手小程序查看原因和解决方案 | + | -15020 | | 操作过快,请稍候再试 | + | -15021 | | 小程序被限频交易 | + + + 错误码 + + | 错误码 | 错误信息 | 说明 | + | - | - | - | + | 1001 | | 参数错误 | + | -1 | | 支付失败 | + | -2 | | 支付取消 | + | -4 | | 风控拦截 | + | -5 | | 开通签约结果未知 | + | -15001 | | 参数错误,具体原因见err_msg | + | -15002 | | outTradeNo重复使用,请换新单号重试 | + | -15003 | | 系统错误 | + | -15004 | | currencyType错误,目前只能填CNY | + | -15005 | | 用户态签名signature错误 | + | -15006 | | 支付签名paySig错误 | + | -15007 | | session_key过期 | + | -15008 | | 二级商户进件未完成 | + | -15009 | | 代币未发布 | + | -15010 | | 道具productId未发布 | + | -15011 | | 现网版本的env只能是0,不能填1(沙盒环境) | + | -15012 | | 调用米大师失败导致关单,请换新单号重试 | + | -15013 | | goodsPrice道具价格错误 | + | -15014 | | 道具/代币发布未生效,禁止下单,大概10分钟后生效 | + | -15016 | | signData格式有问题 | + | -15017 | | 此商家涉嫌违规,收款功能已被限制,暂无法支付。商家可以登录微信商户平台/微信支付商家助手小程序查看原因和解决方案 | + | -15018 | | 代币或者道具productId审核不通过 | + | -15019 | | 调微信报商户受限,商家可以登录微信商户平台/微信支付商家助手小程序查看原因和解决方案 | + | -15020 | | 操作过快,请稍候再试 | + | -15021 | | 小程序被限频交易 | + + + 错误码 + + + 错误信息 + + + 调用成功信息 + + + + 支付的类型, 不同的支付类型有各自额外要传的附加参数 + 可选值: + - 'short_series_goods': 道具直购; + - 'short_series_coin': 代币充值; + + + + + 支付签名, 详见[《签名详解》](https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/virtual-payment.html) + + + + + 具体支付参数见signData, 该参数需以string形式传递, 例如signData: '{"offerId":"123","buyQuantity":1,"env":0,"currencyType":"CNY","productId":"testproductId","goodsPrice":10,"outTradeNo":"xxxxxx","attach":"testdata"}' + + + + + 用户态签名, 详见[《签名详解》](https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/virtual-payment.html) + + + + + 内部预留字段,开发者无需关注 + + + + + 币种 + 可选值: + - 'CNY': 人民币; + + + + + 支付的类型,不同的支付类型有各自额外要传的附加参数。 + 可选值: + - 'game': 购买游戏币; + + + + + 在米大师侧申请的应用 id + + + + + 业务订单号,每个订单号只能使用一次,重复使用会失败。开发者需要确保该订单号在对应游戏下的唯一性,平台会尽可能校验该唯一性约束,但极端情况下可能会跳过对该约束的校验。要求32个字符内,只能是数字、大小写字母、符号_-|*组成,不能以下划线()开头。建议每次调用wx.requestMidasPayment都换新的outTradeNo。若没有传入,则平台会自动填充一个,并以下划线开头 + + + + + 购买数量。mode=game 时必填。购买数量。详见 [buyQuantity 限制说明](#buyquantity-限制说明)。 + + + + + 环境配置 + 可选值: + - 0: 米大师正式环境; + - 1: 米大师沙箱环境; + + + + + 申请接入时的平台,platform 与应用id有关。 + 可选值: + - 'android': android; + + + + + 分区 ID @@ -4144,26 +4287,6 @@ 取值为0/1,取值为0表示会把 `App`、`Page` 的生命周期函数和 `wx` 命名空间下的函数调用写入日志,取值为1则不会。默认值是 0 - - - 从不同渠道获得的OPENLINK字符串 - - - - - 选填,部分活动、功能允许接收自定义query参数,请参阅渠道说明,默认可不填 - - - - - 从不同渠道获得的OPENLINK字符串 - - - - - 选填,部分活动、功能允许接收自定义query参数,请参阅渠道说明,默认可不填 - - 是否有新版本 @@ -7104,55 +7227,6 @@ 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/signature.html) - - - 币种 - 可选值: - - 'CNY': 人民币; - - - - - 支付的类型,不同的支付类型有各自额外要传的附加参数。 - 可选值: - - 'game': 购买游戏币; - - - - - 在米大师侧申请的应用 id - - - - - 业务订单号,每个订单号只能使用一次,重复使用会失败。开发者需要确保该订单号在对应游戏下的唯一性,平台会尽可能校验该唯一性约束,但极端情况下可能会跳过对该约束的校验。要求32个字符内,只能是数字、大小写字母、符号_-|*组成,不能以下划线()开头。建议每次调用wx.requestMidasPayment都换新的outTradeNo。若没有传入,则平台会自动填充一个,并以下划线开头 - - - - - 购买数量。mode=game 时必填。购买数量。详见 [buyQuantity 限制说明](#buyquantity-限制说明)。 - - - - - 环境配置 - 可选值: - - 0: 米大师正式环境; - - 1: 米大师沙箱环境; - - - - - 申请接入时的平台,platform 与应用id有关。 - 可选值: - - 'android': android; - - - - - 分区 ID - - 错误信息 @@ -8550,22 +8624,44 @@ 显示用户信息按钮 + + + 微信小游戏视频组件 + + + + + 视频实例字典 (内部使用,请不要访问) + + + + + 视频实例ID + + + + + 视频创建参数 + + + + + 创建视频实例 + + 实例ID + 创建参数 + + + + 初始化属性 + + 内部函数,请不要调用 - - - 视频的资源地址 - - - - - 视频的封面 - - 视频的左上角横坐标 @@ -8586,9 +8682,69 @@ 视频的高度 - + - Gets a value indicating whether 是否正在播放 + 视频的资源地址 + + + + + 视频的封面 + + + + + 是否为直播 + + + + + 当视频大小与 video 容器大小不一致时,视频的表现形式 + + + + + 是否显示默认播放控件(播放/暂停按钮、播放进度、时间) + + + + + 是否显示播放进度 + + + + + 在非全屏模式下,是否开启亮度和音量调节手势 + + + + + 视频的背景色 + + + + + 是否遵循系统静音开关 + + + + + 是否开启控制进度的手势 + + + + + 是否开启播放手势 + + + + + 是否显示视频中间的播放按钮 + + + + + 销毁当前实例 @@ -8596,44 +8752,31 @@ 播放视频 - + - 监听视频播放事件 + 暂停 - + - 取消监听视频播放事件,action 为空表示移除全部事件监听 + 停止视频 - + - 监听视频播放到末尾事件 + 视频跳转 + 视频跳转到指定位置,单位为 s 秒 - + - 取消监听视频播放到末尾事件 + 视频全屏 + 设置全屏时视频的方向 0: 正常竖向, 90: 屏幕逆时针90度 . -90: 屏幕顺时针90度 - + - 监听视频错误事件 - - - - - 取消监听视频错误事件,action 为空表示移除全部事件监听 - - - - - 监听视频暂停事件 - - - - - 取消监听视频暂停事件,action 为空表示移除全部事件监听 + 视频退出全屏 @@ -8646,36 +8789,45 @@ 取消监听视频由于需要缓冲下一帧而停止时触发,action 为空表示移除全部事件监听 - + - 销毁当前实例 + 监听视频下载(缓冲)事件 + + + + + + 取消监听视频下载(缓冲)事件 ,action 为空表示移除全部事件监听 - + - 视频退出全屏 + 监听视频播放事件 - + - 暂停 + 取消监听视频播放事件,action 为空表示移除全部事件监听 - + - 视频全屏 + 监听视频暂停事件 - 设置全屏时视频的方向 0: 正常竖向, 90: 屏幕逆时针90度 . -90: 屏幕顺时针90度 - + - 视频跳转 + 取消监听视频暂停事件,action 为空表示移除全部事件监听 - 视频跳转到指定位置,单位为 s 秒 - + - 停止视频 + 监听视频播放到末尾事件 + + + + + 取消监听视频播放到末尾事件 @@ -8689,15 +8841,14 @@ 取消监听视频播放进度更新事件,action 为空表示移除全部事件监听 - + - 监听视频下载(缓冲)事件 + 监听视频错误事件 - - + - 取消监听视频下载(缓冲)事件 ,action 为空表示移除全部事件监听 + 取消监听视频错误事件,action 为空表示移除全部事件监听 diff --git a/Runtime/Plugins/wx-runtime.xml.meta b/Runtime/Plugins/wx-runtime.xml.meta index 9fed031e5..6166ab1d3 100644 --- a/Runtime/Plugins/wx-runtime.xml.meta +++ b/Runtime/Plugins/wx-runtime.xml.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b521413075c053e47a06a3b8bc3b7725 +guid: 73f0f5fde7193ea9d6786ceb70926356 DefaultImporter: externalObjects: {} userData: diff --git a/Runtime/WX.cs b/Runtime/WX.cs index cbb9acb6f..9261cb09f 100644 --- a/Runtime/WX.cs +++ b/Runtime/WX.cs @@ -4036,32 +4036,6 @@ namespace WeChatWASM return WXSDKManagerHandler.Instance.GetLogManager(option); } - /// - /// [[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` - /// 小游戏开放页面管理器,用于启动微信内置的各种小游戏活动、功能页面。具体OPENLINK值由不同的能力渠道获得。 - /// **示例代码** - /// ```js - /// const pageManager = wx.createPageManager(); - /// pageManager.load({ - /// openlink: 'xxxxxxx-xxxxxx', // 由不同渠道获得的OPENLINK值 - /// }).then((res) => { - /// // 加载成功,res 可能携带不同活动、功能返回的特殊回包信息(具体请参阅渠道说明) - /// console.log(res); - /// // 加载成功后按需显示 - /// pageManager.show(); - /// }).catch((err) => { - /// // 加载失败,请查阅 err 给出的错误信息 - /// console.error(err); - /// }) - /// ``` - /// - /// - public static WXPageManager CreatePageManager() - { - return WXSDKManagerHandler.Instance.CreatePageManager(); - } - /// /// [[RealtimeLogManager](https://developers.weixin.qq.com/minigame/dev/api/base/debug/RealtimeLogManager.html) wx.getRealtimeLogManager()](https://developers.weixin.qq.com/minigame/dev/api/base/debug/wx.getRealtimeLogManager.html) /// 需要基础库: `2.14.4` diff --git a/Runtime/WXBase.cs b/Runtime/WXBase.cs index 3daf90bc9..5a74542d4 100644 --- a/Runtime/WXBase.cs +++ b/Runtime/WXBase.cs @@ -535,7 +535,7 @@ namespace WeChatWASM /// /// /// - public static WXVideo CreateVideo(WXCreateVideoParam param) + public static WXVideo CreateVideo(CreateVideoOption param) { return WXSDKManagerHandler.Instance.CreateVideo(param); } @@ -1127,6 +1127,41 @@ namespace WeChatWASM WXSDKManagerHandler.Instance.NotifyMiniProgramPlayableStatus(option); } #endregion +#region 虚拟支付 + /// + /// 请求虚拟支付 + /// + public static void RequestVirtualPayment(RequestVirtualPaymentOption option) + { + WXSDKManagerHandler.Instance.RequestVirtualPayment(option); + } +#endregion + + /// + /// [[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` + /// 小游戏开放页面管理器,用于启动微信内置的各种小游戏活动、功能页面。具体OPENLINK值由不同的能力渠道获得。 + /// **示例代码** + /// ```js + /// const pageManager = wx.createPageManager(); + /// pageManager.load({ + /// openlink: 'xxxxxxx-xxxxxx', // 由不同渠道获得的OPENLINK值 + /// }).then((res) => { + /// // 加载成功,res 可能携带不同活动、功能返回的特殊回包信息(具体请参阅渠道说明) + /// console.log(res); + /// // 加载成功后按需显示 + /// pageManager.show(); + /// }).catch((err) => { + /// // 加载失败,请查阅 err 给出的错误信息 + /// console.error(err); + /// }) + /// ``` + /// + /// + public static WXPageManager CreatePageManager() + { + return WXSDKManagerHandler.Instance.CreatePageManager(); + } } } #endif diff --git a/Runtime/WXSDKPerf/WXPerfEngine.cs b/Runtime/WXSDKPerf/WXPerfEngine.cs index 88cdd1586..19a1f7cf9 100644 --- a/Runtime/WXSDKPerf/WXPerfEngine.cs +++ b/Runtime/WXSDKPerf/WXPerfEngine.cs @@ -8,6 +8,10 @@ using UnityEngine; using UnityEngine.Scripting; using System.IO; +using Unity.Profiling; +using UnityEngine.Profiling; +using Debug = UnityEngine.Debug; + #if PLATFORM_WEIXINMINIGAME || PLATFORM_WEBGL || UNITY_EDITOR @@ -20,17 +24,17 @@ namespace WXSDKPerf public class WXPerfEngine { #if !UNITY_EDITOR - static WXPerfEngine_Implementation m_PerfEngineImplementation = null; + static WXPerfEngine_Implementation m_PerfEngineImplementation = null; #endif [RuntimeInitializeOnLoadMethod] public static void StartWXPerfEngine() { #if UNITY_EDITOR - return; + return; #else m_PerfEngineImplementation = new WXPerfEngine_Implementation(); - m_PerfEngineImplementation.StartPerfEngine(); + m_PerfEngineImplementation.StartPerfEngine(); #endif } @@ -45,7 +49,7 @@ namespace WXSDKPerf public static void Annotation(string InAnnotationString) { #if UNITY_EDITOR - return; + return; #else // Don't record annotation if we are not recording. if (!IsRecording()) @@ -68,7 +72,7 @@ namespace WXSDKPerf #endif } - + /// /// 检查是否正在录制性能数据 /// @@ -89,14 +93,14 @@ namespace WXSDKPerf #else DateTime timestamp = DateTime.Now; var dateString = timestamp.ToLocalTime().ToString("yyyy-MM-dd_HH-mm-ss", System.Globalization.CultureInfo.InvariantCulture); - var snapshotFileName = $"{dateString}.snap"; + var snapshotFileName = $"{dateString}.snap"; #if UNITY_2018_3_OR_NEWER && !UNITY_2022_2_OR_NEWER - UnityEngine.Profiling.Memory.Experimental.MemoryProfiler.TakeSnapshot(Path.Combine(Application.persistentDataPath, snapshotFileName), + UnityEngine.Profiling.Memory.Experimental.MemoryProfiler.TakeSnapshot(Path.Combine(Application.persistentDataPath, snapshotFileName), WXPerfEngine_Implementation.CaptureSnapshotCallback, (UnityEngine.Profiling.Memory.Experimental.CaptureFlags)31); - + #elif UNITY_2022_2_OR_NEWER - Unity.Profiling.Memory.MemoryProfiler.TakeSnapshot(Path.Combine(Application.persistentDataPath, snapshotFileName), + Unity.Profiling.Memory.MemoryProfiler.TakeSnapshot(Path.Combine(Application.persistentDataPath, snapshotFileName), WXPerfEngine_Implementation.CaptureSnapshotCallback, (Unity.Profiling.Memory.CaptureFlags)31); #endif #endif @@ -109,7 +113,7 @@ namespace WXSDKPerf public static void SetLuaState(IntPtr L) { #if UNITY_EDITOR - return; + return; #else if (m_PerfEngineImplementation == null) { @@ -120,7 +124,7 @@ namespace WXSDKPerf m_PerfEngineImplementation.SetLuaState(L); #endif } - + /// /// 声明自定义性能指标 /// @@ -130,7 +134,7 @@ namespace WXSDKPerf public static void DeclareCustomStatInfo(string inStatName, string inStatCategory, int inStatInterpType = 1) { #if UNITY_EDITOR - return; + return; #else if (m_PerfEngineImplementation == null) { @@ -151,7 +155,7 @@ namespace WXSDKPerf public static void SetCustomStatValue(string inStatName, float inValue) { #if UNITY_EDITOR - return; + return; #else if (m_PerfEngineImplementation == null) { @@ -171,7 +175,7 @@ namespace WXSDKPerf public static void AddCustomStatInfoBy(string inStatName, float inValue) { #if UNITY_EDITOR - return; + return; #else if (m_PerfEngineImplementation == null) { @@ -179,9 +183,9 @@ namespace WXSDKPerf return; } - m_PerfEngineImplementation.AddCustomStatInfoBy(inStatName, inValue); + m_PerfEngineImplementation.AddCustomStatInfoBy(inStatName, inValue); #endif - + } @@ -195,11 +199,11 @@ namespace WXSDKPerf /// 是否启用资源捕获 /// 是否启用Lua内存监控 /// 是否启用Lua函数内存跟踪 - public static void StartRecordManually(bool inEnableStackTrace, bool inEnableStatInfo, bool inFrequentScreenShot, bool inEnablebRenderInst, + public static void StartRecordManually(bool inEnableStackTrace, bool inEnableStatInfo, bool inFrequentScreenShot, bool inEnablebRenderInst, bool inEnableCaptureResource, bool inEnableLuaMemoryMonitor, bool inEnableLuaFunctionMemoryTracking) { #if UNITY_EDITOR - return; + return; #else if (m_PerfEngineImplementation == null) { @@ -207,7 +211,7 @@ namespace WXSDKPerf return; } - m_PerfEngineImplementation.StartRecordManually(inEnableStackTrace, inEnableStatInfo, inFrequentScreenShot, inEnablebRenderInst, + m_PerfEngineImplementation.StartRecordManually(inEnableStackTrace, inEnableStatInfo, inFrequentScreenShot, inEnablebRenderInst, inEnableCaptureResource, inEnableLuaMemoryMonitor, inEnableLuaFunctionMemoryTracking); #endif } @@ -218,7 +222,7 @@ namespace WXSDKPerf public static void StopRecordManually() { #if UNITY_EDITOR - return; + return; #else if (m_PerfEngineImplementation == null) { diff --git a/Runtime/playable-default/check-version.js.meta b/Runtime/playable-default/check-version.js.meta index cb3eef9b9..9f7c68a71 100644 --- a/Runtime/playable-default/check-version.js.meta +++ b/Runtime/playable-default/check-version.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: e5108f88099bb61c1ac7bce85c058bbb -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 8d3e8e044df6c2205ce1819e5a59ce45 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/data-package.meta b/Runtime/playable-default/data-package.meta index c420d8876..83906987b 100644 --- a/Runtime/playable-default/data-package.meta +++ b/Runtime/playable-default/data-package.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 0273befd5791516c05640b866a4057ac +guid: 4a31dd202fa1d4587a85cba4f0c667cc 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 642706f47..7495f568b 100644 --- a/Runtime/playable-default/data-package/game.js.meta +++ b/Runtime/playable-default/data-package/game.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 92af1c93c32d8868b037a614a7c51557 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: fc9b81dcc97ac15f78c67b22645b5156 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/events.js.meta b/Runtime/playable-default/events.js.meta index 510a84ef9..92f56ce06 100644 --- a/Runtime/playable-default/events.js.meta +++ b/Runtime/playable-default/events.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 82a6bdd86dff7182973b291cb71e97cf -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 6d2369838be13214bd54aa0fc21b7d44 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/game.js.meta b/Runtime/playable-default/game.js.meta index 5673d7fd9..83b5489dc 100644 --- a/Runtime/playable-default/game.js.meta +++ b/Runtime/playable-default/game.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 531515f3324b0cf5a249ca868fbb957e -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: e0df799a91a2d21cebe277c71f6f1b47 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/game.json.meta b/Runtime/playable-default/game.json.meta index 201839a98..10888530e 100644 --- a/Runtime/playable-default/game.json.meta +++ b/Runtime/playable-default/game.json.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 3b395b6e591cc8b3668e0b64e63fc88b -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 829a267043b8efe45ec32538e04e38cb + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/playable-fix.js.meta b/Runtime/playable-default/playable-fix.js.meta index 83e9f5e7c..6be386b4d 100644 --- a/Runtime/playable-default/playable-fix.js.meta +++ b/Runtime/playable-default/playable-fix.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: d04f0a28a0ef5cdd7a1d23182b85b42f -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: ea7e8d519365e09f47543df7afbddd60 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/plugin-config.js.meta b/Runtime/playable-default/plugin-config.js.meta index de6042ee1..f4e7b112d 100644 --- a/Runtime/playable-default/plugin-config.js.meta +++ b/Runtime/playable-default/plugin-config.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 9bcc1936d8e45b5791c599fe8253919c -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: e9ba345b6a1cfac5e5b1baece5818f32 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/plugins.meta b/Runtime/playable-default/plugins.meta index 3ecc6d920..dec614827 100644 --- a/Runtime/playable-default/plugins.meta +++ b/Runtime/playable-default/plugins.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d52a1b6e1c06472f3a3a461209736492 +guid: 0415e69a2d982ea2f4e243b28fa26929 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 28e737324..4ed8d16f1 100644 --- a/Runtime/playable-default/plugins/check-update.js.meta +++ b/Runtime/playable-default/plugins/check-update.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: bbec39b14da95d130e2852e718bcee52 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 8460d6ded5618c2fe3c2e26ab171d528 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/plugins/screen-adapter.js.meta b/Runtime/playable-default/plugins/screen-adapter.js.meta index e4d35a56a..e712e5c6e 100644 --- a/Runtime/playable-default/plugins/screen-adapter.js.meta +++ b/Runtime/playable-default/plugins/screen-adapter.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 5811c5c2d62fc7802c64f1d2b23745f1 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 2d594a8f2c696984c5aec107164e76f9 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/project.config.json.meta b/Runtime/playable-default/project.config.json.meta index c9359895f..e5894ce6c 100644 --- a/Runtime/playable-default/project.config.json.meta +++ b/Runtime/playable-default/project.config.json.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 6dae963d59fa4418d09722a93e87d793 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 3382ae1c51f722f746a53c8397691245 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/texture-config.js.meta b/Runtime/playable-default/texture-config.js.meta index f56c6670a..33fbc6e90 100644 --- a/Runtime/playable-default/texture-config.js.meta +++ b/Runtime/playable-default/texture-config.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 854f4bd8ff1dd4750841937bcddeaf70 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 0ba24dde237fdc978ff56dd2250f5482 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-namespace.js.meta b/Runtime/playable-default/unity-namespace.js.meta index 98238ed1a..f5a4bed5d 100644 --- a/Runtime/playable-default/unity-namespace.js.meta +++ b/Runtime/playable-default/unity-namespace.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 2c062721204b988f19733cfdcfb64e34 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: c9cf42b246500482b8cba544ab18c38c + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-playable-plugin.meta b/Runtime/playable-default/unity-playable-plugin.meta index 5bedee76a..d929ecb03 100644 --- a/Runtime/playable-default/unity-playable-plugin.meta +++ b/Runtime/playable-default/unity-playable-plugin.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 31f9cc6cd458af9ae649ac0f4cc8772e +guid: fe863fbe7df4acac64ba936b76981a87 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 ae879b0ee..efc16a4a3 100644 --- a/Runtime/playable-default/unity-playable-plugin/index.js.meta +++ b/Runtime/playable-default/unity-playable-plugin/index.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 2a92708403fe30f324cbf69ccf64a5ca -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 5667dda7d63d3e790db64d20a50e53d7 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-sdk.meta b/Runtime/playable-default/unity-sdk.meta index 92b56b4ef..606483c3c 100644 --- a/Runtime/playable-default/unity-sdk.meta +++ b/Runtime/playable-default/unity-sdk.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d0a26195cb9a986d48760de79dc69c05 +guid: 796b04fbf1fa2b3bfcfa2b80f4d2e837 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/playable-default/unity-sdk/audio.meta b/Runtime/playable-default/unity-sdk/audio.meta index 0763cedae..14b2ad4c5 100644 --- a/Runtime/playable-default/unity-sdk/audio.meta +++ b/Runtime/playable-default/unity-sdk/audio.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ceec02b40e3331d02d75fa809a9760a7 +guid: 84881ed29a07b082c2056962365f976d 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 4eacd8bca..bc11455e1 100644 --- a/Runtime/playable-default/unity-sdk/audio/common.js.meta +++ b/Runtime/playable-default/unity-sdk/audio/common.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: a5bfd354ed4424c67e796543113905e3 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 9a9b82828681d31f3bf8dbd1070f233e + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-sdk/audio/const.js.meta b/Runtime/playable-default/unity-sdk/audio/const.js.meta index 95b4fa6f1..23497e2f4 100644 --- a/Runtime/playable-default/unity-sdk/audio/const.js.meta +++ b/Runtime/playable-default/unity-sdk/audio/const.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 3a4d82e9de0cb38b0c9224360f3ad139 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 83e05223787367362bb499322ebcbcd2 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-sdk/audio/index.js.meta b/Runtime/playable-default/unity-sdk/audio/index.js.meta index e91d0155f..e76815613 100644 --- a/Runtime/playable-default/unity-sdk/audio/index.js.meta +++ b/Runtime/playable-default/unity-sdk/audio/index.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 23b767c936834d1b790a40ea00e26d64 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 06859dca228ca66fea3992ed30fba8e5 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file 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 394be452d..8110a0f91 100644 --- a/Runtime/playable-default/unity-sdk/audio/inner-audio.js.meta +++ b/Runtime/playable-default/unity-sdk/audio/inner-audio.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 968b47eba0189213d3a4cfabbadee54c -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: e49d3c13e975031b70c483e1ed603afe + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-sdk/audio/store.js.meta b/Runtime/playable-default/unity-sdk/audio/store.js.meta index 4454dee39..ee8d7a988 100644 --- a/Runtime/playable-default/unity-sdk/audio/store.js.meta +++ b/Runtime/playable-default/unity-sdk/audio/store.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 710313a81f77482d26012751c5d6592a -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: d248c4018fb61ecb908ba00739d01f07 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file 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 2ed354708..14ec21e24 100644 --- a/Runtime/playable-default/unity-sdk/audio/unity-audio.js.meta +++ b/Runtime/playable-default/unity-sdk/audio/unity-audio.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 8342caa71b7edf46f906aa855aea4ef3 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 718c91781714a7b6e55192f71021c111 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-sdk/audio/utils.js.meta b/Runtime/playable-default/unity-sdk/audio/utils.js.meta index 71871e238..41e1003eb 100644 --- a/Runtime/playable-default/unity-sdk/audio/utils.js.meta +++ b/Runtime/playable-default/unity-sdk/audio/utils.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: c92653458db092aae35564ef3edd6252 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 87fd398552f71fc18b7081ae7ffdef57 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-sdk/canvas-context.js.meta b/Runtime/playable-default/unity-sdk/canvas-context.js.meta index 4d41da479..c1fe43f51 100644 --- a/Runtime/playable-default/unity-sdk/canvas-context.js.meta +++ b/Runtime/playable-default/unity-sdk/canvas-context.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 6e3f60a883fb2f8249ce74acf2c14acd -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 9c5773dae458d8d31c7f11fc0add3690 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-sdk/canvas.js.meta b/Runtime/playable-default/unity-sdk/canvas.js.meta index 2ae4eb817..27d96a8aa 100644 --- a/Runtime/playable-default/unity-sdk/canvas.js.meta +++ b/Runtime/playable-default/unity-sdk/canvas.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: cdaa05d30f80a46dddcc25d674615153 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 6b8b462632c2f7613e7cc0c1119025ac + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-sdk/conf.js.meta b/Runtime/playable-default/unity-sdk/conf.js.meta index 04cdeb089..293b17ece 100644 --- a/Runtime/playable-default/unity-sdk/conf.js.meta +++ b/Runtime/playable-default/unity-sdk/conf.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 95650874bc818949f578987590377532 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 84fba3d688f27373813d8b76f49bacb5 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-sdk/file-info.js.meta b/Runtime/playable-default/unity-sdk/file-info.js.meta index ea23a1717..e762250a2 100644 --- a/Runtime/playable-default/unity-sdk/file-info.js.meta +++ b/Runtime/playable-default/unity-sdk/file-info.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 7e863e19487a6cda9d53bbfc8e3fbd03 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 028168a2cac97f16c8ebf98e5b676723 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-sdk/fix.js.meta b/Runtime/playable-default/unity-sdk/fix.js.meta index 9ba2119e5..6a7ea1dd8 100644 --- a/Runtime/playable-default/unity-sdk/fix.js.meta +++ b/Runtime/playable-default/unity-sdk/fix.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 9733080f2e9cef0f03c3d0ee1dad8983 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 146c71b4b08001e55ca1333402310e8c + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-sdk/fs.js.meta b/Runtime/playable-default/unity-sdk/fs.js.meta index 88754bd69..d5d0b6057 100644 --- a/Runtime/playable-default/unity-sdk/fs.js.meta +++ b/Runtime/playable-default/unity-sdk/fs.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: d1ab83ac4fb090597d227ff725dbb6f7 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: d2b2e4ffa8fbcc253127fe5c2d4be5c7 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-sdk/index.js.meta b/Runtime/playable-default/unity-sdk/index.js.meta index 00a143387..647647402 100644 --- a/Runtime/playable-default/unity-sdk/index.js.meta +++ b/Runtime/playable-default/unity-sdk/index.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 745ed2f1262c74198123f00a889f2b22 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 54cbff6ff1c1bb0c4045d7ad1dff8c71 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-sdk/logger.js.meta b/Runtime/playable-default/unity-sdk/logger.js.meta index 4cde22df8..be5ab33b1 100644 --- a/Runtime/playable-default/unity-sdk/logger.js.meta +++ b/Runtime/playable-default/unity-sdk/logger.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 23879d36971922e903eddd9885892fb3 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 487beba01cc78d65dce5dd0e0dfded2e + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-sdk/mobileKeyboard.meta b/Runtime/playable-default/unity-sdk/mobileKeyboard.meta index 6502a8843..f9b8ed71b 100644 --- a/Runtime/playable-default/unity-sdk/mobileKeyboard.meta +++ b/Runtime/playable-default/unity-sdk/mobileKeyboard.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 481df7275cffcd473c8a1114f7d73979 +guid: 848a7bcc88d983f42b19e6c85a7a3865 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 1b1f330cf..72f6bc88e 100644 --- a/Runtime/playable-default/unity-sdk/mobileKeyboard/index.js.meta +++ b/Runtime/playable-default/unity-sdk/mobileKeyboard/index.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 62febf55450b14dd5e6d76f19bbd702a -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 846c2b864d1f3ada23aa9c83cb45e872 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-sdk/module-helper.js.meta b/Runtime/playable-default/unity-sdk/module-helper.js.meta index f55220b70..18bfa85aa 100644 --- a/Runtime/playable-default/unity-sdk/module-helper.js.meta +++ b/Runtime/playable-default/unity-sdk/module-helper.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: faeaa5621fd2c89ab8be9d59a5bfd49b -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 0e0e86e30896c216d4efc0efc5eb5ce5 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-sdk/recorder.js.meta b/Runtime/playable-default/unity-sdk/recorder.js.meta index 0498b1f55..6206bfba5 100644 --- a/Runtime/playable-default/unity-sdk/recorder.js.meta +++ b/Runtime/playable-default/unity-sdk/recorder.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 1ce4ef1463f0ff2eb0b56e23d2871901 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 7f6f26019ddd3fb3da6ed09909e9e718 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-sdk/resType.js b/Runtime/playable-default/unity-sdk/resType.js index e81a85770..1cc38b161 100644 --- a/Runtime/playable-default/unity-sdk/resType.js +++ b/Runtime/playable-default/unity-sdk/resType.js @@ -1,4 +1,11 @@ export const ResType = { + Gamepad: { + axes: 'IAnyObject[]', + buttons: 'IAnyObject[]', + connected: 'bool', + id: 'string', + index: 'string', + }, AccountInfo: { miniProgram: 'MiniProgram', plugin: 'Plugin', @@ -496,7 +503,7 @@ export const ResType = { headUrl: 'string', nickname: 'string', nonceId: 'string', - otherInfos: 'AnyKeyword[]', + otherInfos: 'any[]', replayStatus: 'number', status: 'number', errMsg: 'string', @@ -505,7 +512,7 @@ export const ResType = { headUrl: 'string', nickname: 'string', noticeId: 'string', - otherInfos: 'AnyKeyword[]', + otherInfos: 'any[]', reservable: 'bool', startTime: 'string', status: 'number', @@ -574,6 +581,11 @@ export const ResType = { weakNet: 'bool', errMsg: 'string', }, + GetPhoneNumberSuccessCallbackResult: { + code: 'string', + errMsg: 'string', + errno: 'number', + }, GetPrivacySettingSuccessCallbackResult: { needAuthorization: 'bool', privacyContractName: 'string', @@ -598,6 +610,10 @@ export const ResType = { mainSwitch: 'bool', itemSettings: 'object', }, + GetShowSplashAdStatusSuccessCallbackResult: { + status: 'string', + errMsg: 'string', + }, GetStorageInfoSuccessCallbackOption: { currentSize: 'number', keys: 'string[]', @@ -724,6 +740,12 @@ export const ResType = { message: 'string', stack: 'string', }, + OnGamepadConnectedListenerResult: { + gamepad: 'string', + }, + OnGamepadDisconnectedListenerResult: { + gamepad: 'string', + }, OnHandoffListenerResult: { query: 'string', }, @@ -741,14 +763,6 @@ export const ResType = { OnMemoryWarningListenerResult: { level: 'number', }, - OnMenuButtonBoundingClientRectWeightChangeListenerResult: { - bottom: 'number', - height: 'number', - left: 'number', - right: 'number', - top: 'number', - width: 'number', - }, OnMouseDownListenerResult: { button: 'number', timeStamp: 'long', @@ -849,17 +863,6 @@ export const ResType = { subscriptionsSetting: 'SubscriptionsSetting', errMsg: 'string', }, - OperateGameRecorderVideoOption: { - atempo: 'number', - audioMix: 'bool', - bgm: 'string', - desc: 'string', - path: 'string', - query: 'string', - timeRange: 'number[]', - title: 'string', - volume: 'number', - }, MediaSource: { url: 'string', poster: 'string', diff --git a/Runtime/playable-default/unity-sdk/resType.js.meta b/Runtime/playable-default/unity-sdk/resType.js.meta index 51752895f..e0ea4f0f1 100644 --- a/Runtime/playable-default/unity-sdk/resType.js.meta +++ b/Runtime/playable-default/unity-sdk/resType.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 4804e01bf66b4037ae3257077b1fa612 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 2ec2332fcb9a2cee2781f7fde8e4577d + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-sdk/resTypeOther.js.meta b/Runtime/playable-default/unity-sdk/resTypeOther.js.meta index 9ccd6f00b..5a419d4b2 100644 --- a/Runtime/playable-default/unity-sdk/resTypeOther.js.meta +++ b/Runtime/playable-default/unity-sdk/resTypeOther.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: b53fa697f1378a92419ab4cdf86f71f7 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: fc9b5dddd600ed6eb6ce6f9ca847430e + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-sdk/response.js.meta b/Runtime/playable-default/unity-sdk/response.js.meta index 76b8485e4..aad55fab0 100644 --- a/Runtime/playable-default/unity-sdk/response.js.meta +++ b/Runtime/playable-default/unity-sdk/response.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: c0bdb6ec2e9b51a1de21189c1df0b82d -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 7a924f4f687a63b131da5604511a0cd2 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-sdk/sdk.js b/Runtime/playable-default/unity-sdk/sdk.js index d1230f719..0c1957ed6 100644 --- a/Runtime/playable-default/unity-sdk/sdk.js +++ b/Runtime/playable-default/unity-sdk/sdk.js @@ -23,7 +23,7 @@ function getClassObject(className, id) { // eslint-disable-next-line @typescript-eslint/naming-convention function WX_OneWayNoFunction(functionName, ...params) { - wx[functionName.replace(/^\w/, a => a.toLowerCase())](...params); + wx[functionName.replace(/^\w/, (a) => a.toLowerCase())](...params); } @@ -33,7 +33,7 @@ const onlyReadyResponse = [ ]; // eslint-disable-next-line @typescript-eslint/naming-convention function WX_SyncFunction(functionName, ...params) { - return wx[functionName.replace(/^\w/, a => a.toLowerCase())](...params); + return wx[functionName.replace(/^\w/, (a) => a.toLowerCase())](...params); } // eslint-disable-next-line @typescript-eslint/naming-convention @@ -42,13 +42,22 @@ function WX_ClassOneWayNoFunction(className, functionName, id, ...params) { if (!obj) { return; } - obj[functionName.replace(/^\w/, a => a.toLowerCase())](...params); + obj[functionName.replace(/^\w/, (a) => a.toLowerCase())](...params); +} +function classFormatAndSend(id, callbackId, callbackName, callbackType, resType, res) { + formatResponse(resType, res); + moduleHelper.send(callbackName, classGetMsg(id, callbackId, callbackType, res)); +} +function classGetMsg(id, callbackId, resType, res) { + return JSON.stringify({ + id, callbackId, type: resType, res: JSON.stringify(res) || '', + }); } export default { WX_OneWayFunction(functionName, successType, failType, completeType, conf, callbackId) { - const lowerFunctionName = functionName.replace(/^\w/, a => a.toLowerCase()); + const lowerFunctionName = functionName.replace(/^\w/, (a) => a.toLowerCase()); const config = formatJsonStr(conf); - + // specialJS if (lowerFunctionName === 'login') { if (!config.timeout) { delete config.timeout; @@ -111,7 +120,7 @@ export default { moduleHelper.send(`_${functionName}Callback`, resStr); }; onEventLists[functionName].push(callback); - wx[functionName.replace(/^\w/, a => a.toLowerCase())](callback); + wx[functionName.replace(/^\w/, (a) => a.toLowerCase())](callback); }, WX_OffEventRegister(functionName) { (onEventLists[functionName] || []).forEach((v) => { @@ -225,7 +234,7 @@ export default { }, WX_SyncFunction_t(functionName, returnType) { const res = WX_SyncFunction(functionName); - if (onlyReadyResponse.includes(functionName.replace(/^\w/, a => a.toLowerCase()))) { + if (onlyReadyResponse.includes(functionName.replace(/^\w/, (a) => a.toLowerCase()))) { formatResponse(returnType, JSON.parse(JSON.stringify(res))); return JSON.stringify(res); } @@ -262,10 +271,10 @@ export default { formatResponse(returnType, res); return JSON.stringify(res); }, - WX_ClassOneWayFunction(functionName, returnType, successType, failType, completeType, conf) { + WX_ClassConstructor(functionName, returnType, successType, failType, completeType, conf) { const config = formatJsonStr(conf); const callbackId = uid(); - const obj = wx[functionName.replace(/^\w/, a => a.toLowerCase())]({ + const obj = wx[functionName.replace(/^\w/, (a) => a.toLowerCase())]({ ...config, success(res) { formatResponse(successType, res); @@ -293,7 +302,7 @@ export default { return callbackId; }, WX_ClassFunction(functionName, returnType, option) { - const obj = wx[functionName.replace(/^\w/, a => a.toLowerCase())](formatJsonStr(option)); + const obj = wx[functionName.replace(/^\w/, (a) => a.toLowerCase())](formatJsonStr(option)); const id = uid(); if (!ClassLists[returnType]) { ClassLists[returnType] = {}; @@ -347,10 +356,10 @@ export default { ClassOnEventLists[className + functionName][id + eventName].push(callback); // WXVideoDecoder OnEvent 不规范 特殊处理 if (className === 'WXVideoDecoder') { - obj[functionName.replace(/^\w/, a => a.toLowerCase())](eventName, callback); + obj[functionName.replace(/^\w/, (a) => a.toLowerCase())](eventName, callback); } else { - obj[functionName.replace(/^\w/, a => a.toLowerCase())](callback); + obj[functionName.replace(/^\w/, (a) => a.toLowerCase())](callback); } }, WX_ClassOffEventFunction(className, functionName, id, eventName) { @@ -389,7 +398,7 @@ export default { if (!obj) { return JSON.stringify(formatResponse(returnType)); } - const res = obj[functionName.replace(/^\w/, a => a.toLowerCase())](); + const res = obj[functionName.replace(/^\w/, (a) => a.toLowerCase())](); return JSON.stringify(formatResponse(returnType, res, id)); }, WX_ClassOneWayNoFunction_vt(className, functionName, id, param1) { @@ -399,4 +408,41 @@ export default { WX_ClassOneWayNoFunction_vn(className, functionName, id, param1) { WX_ClassOneWayNoFunction(className, functionName, id, param1); }, + WX_ClassOneWayFunction(className, functionName, id, successType, failType, completeType, conf, callbackId, usePromise = false) { + + const obj = getClassObject(className, id); + if (!obj) { + return; + } + const lowerFunctionName = functionName.replace(/^\w/, (a) => a.toLowerCase()); + const config = formatJsonStr(conf); + + if (usePromise) { + obj[lowerFunctionName]({ + ...config, + }).then((res) => { + classFormatAndSend(id, callbackId, `_${className}${functionName}Callback`, 'success', successType, res); + }) + .catch((res) => { + classFormatAndSend(id, callbackId, `_${className}${functionName}Callback`, 'fail', failType, res); + }) + .finally((res) => { + classFormatAndSend(id, callbackId, `_${className}${functionName}Callback`, 'complete', completeType, res); + }); + } + else { + obj[lowerFunctionName]({ + ...config, + success(res) { + classFormatAndSend(id, callbackId, `_${className}${functionName}Callback`, 'success', successType, res); + }, + fail(res) { + classFormatAndSend(id, callbackId, `_${className}${functionName}Callback`, 'fail', failType, res); + }, + complete(res) { + classFormatAndSend(id, callbackId, `_${className}${functionName}Callback`, 'complete', completeType, res); + }, + }); + } + }, }; diff --git a/Runtime/playable-default/unity-sdk/sdk.js.meta b/Runtime/playable-default/unity-sdk/sdk.js.meta index 216f77e64..5a06ab292 100644 --- a/Runtime/playable-default/unity-sdk/sdk.js.meta +++ b/Runtime/playable-default/unity-sdk/sdk.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 45586bcf2aec8da319b74e07858c2427 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 9d1d40e411062d95d5e5a826fca7407f + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-sdk/special-callbacks.js.meta b/Runtime/playable-default/unity-sdk/special-callbacks.js.meta index e964bc584..17876803b 100644 --- a/Runtime/playable-default/unity-sdk/special-callbacks.js.meta +++ b/Runtime/playable-default/unity-sdk/special-callbacks.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 38fecf1cc6b371057e50349b5f3551cd -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 9824f48deb66fd456ff9911fb139edaa + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-sdk/texture.js.meta b/Runtime/playable-default/unity-sdk/texture.js.meta index c237e20ea..643afab5c 100644 --- a/Runtime/playable-default/unity-sdk/texture.js.meta +++ b/Runtime/playable-default/unity-sdk/texture.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: f142ec01c4dba069b031185ebf7b072b -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: db1ab9b78a957e1a0e85537dcf84398a + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-sdk/touch.meta b/Runtime/playable-default/unity-sdk/touch.meta index 69900ba45..2f08028da 100644 --- a/Runtime/playable-default/unity-sdk/touch.meta +++ b/Runtime/playable-default/unity-sdk/touch.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4b807ee5567f2a193edfca4bdffbd798 +guid: fd914dbcd84e84df6f9074252d40b203 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 5b29a241e..ed55ffe2f 100644 --- a/Runtime/playable-default/unity-sdk/touch/index.js.meta +++ b/Runtime/playable-default/unity-sdk/touch/index.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 8a6e150eef26403510c814e0e93a2694 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 5f882f41fe48cd2b2b49f8c15b4ecdea + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-sdk/util.js.meta b/Runtime/playable-default/unity-sdk/util.js.meta index 1ebb7b57f..e9fd0f40e 100644 --- a/Runtime/playable-default/unity-sdk/util.js.meta +++ b/Runtime/playable-default/unity-sdk/util.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 4c10ebb6213c7a7fa92a91ba5c9649ee -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 101716bf913536da0fb256ead631e637 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-sdk/utils.js.meta b/Runtime/playable-default/unity-sdk/utils.js.meta index 0c20f49bd..f9413852c 100644 --- a/Runtime/playable-default/unity-sdk/utils.js.meta +++ b/Runtime/playable-default/unity-sdk/utils.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: e9a5598b8047e5073d8baa4c8df0c978 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: f2424715725f6103ad5c4e0bf4441ece + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-sdk/video.js b/Runtime/playable-default/unity-sdk/video.js index e81be2bbe..56bc70f05 100644 --- a/Runtime/playable-default/unity-sdk/video.js +++ b/Runtime/playable-default/unity-sdk/video.js @@ -18,12 +18,15 @@ export default { if (!obj) { return; } - if (key === 'x' || key === 'y' || key === 'width' || key === 'height') { + if (key === 'x' || key === 'y' || key === 'width' || key === 'height' || key === 'playbackRate' || key === 'initialTime') { obj[key] = +value; } else if (key === 'src' || key === 'poster') { obj[key] = value; } + else if (key === 'loop' || key === 'muted') { + obj[key] = value === 'true'; + } }, WXVideoPlay(id) { const obj = getObject(id); @@ -40,10 +43,11 @@ export default { obj[key]((e) => { moduleHelper.send('OnVideoCallback', JSON.stringify({ callbackId: id, - errMsg: key, + type: key, position: e && e.position, buffered: e && e.buffered, duration: e && e.duration, + errMsg: e && e.errMsg, })); if (key === 'onError') { GameGlobal.enableTransparentCanvas = false; diff --git a/Runtime/playable-default/unity-sdk/video.js.meta b/Runtime/playable-default/unity-sdk/video.js.meta index 8486d4011..a00de4ba1 100644 --- a/Runtime/playable-default/unity-sdk/video.js.meta +++ b/Runtime/playable-default/unity-sdk/video.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 828f84320fa56abfa00ee9a5c916cbb9 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 44cf08284567651420e4d64d58a7e1e8 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/unity-sdk/video.meta b/Runtime/playable-default/unity-sdk/video.meta index d00b60366..3c7a53ed8 100644 --- a/Runtime/playable-default/unity-sdk/video.meta +++ b/Runtime/playable-default/unity-sdk/video.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4b8a6a9e53972c103f0eb844fed1ea99 +guid: bdefd516a8438d7e7f7faa8df19d7bfb folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/playable-default/unity-sdk/video/index.js.meta b/Runtime/playable-default/unity-sdk/video/index.js.meta index f4b5664e3..7d6165707 100644 --- a/Runtime/playable-default/unity-sdk/video/index.js.meta +++ b/Runtime/playable-default/unity-sdk/video/index.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: d85c26bfbd9a3283f6bb30cceca5ea5e -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: c173e24611cf36e062cd2b45c0025025 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/wasmcode.meta b/Runtime/playable-default/wasmcode.meta index 4e5e5c679..2d2c394cf 100644 --- a/Runtime/playable-default/wasmcode.meta +++ b/Runtime/playable-default/wasmcode.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 88c2c4f8b42d569b8094feb74e6da2a1 +guid: 0f652f89c49eb7aa92930e1f0b596900 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/playable-default/wasmcode/game.js.meta b/Runtime/playable-default/wasmcode/game.js.meta index e4e93d144..0f3c6d891 100644 --- a/Runtime/playable-default/wasmcode/game.js.meta +++ b/Runtime/playable-default/wasmcode/game.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 498e07525985bb6ced0bd9306b09f6a4 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 0e13c34e89af3ff1d643965079480b0a + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/playable-default/weapp-adapter.js.meta b/Runtime/playable-default/weapp-adapter.js.meta index ad293ebd0..450ff3ee3 100644 --- a/Runtime/playable-default/weapp-adapter.js.meta +++ b/Runtime/playable-default/weapp-adapter.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 73905f6b06e6cb50adcc24a126ed8b65 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 9445f040d635c13f13b3b643840b8407 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/check-version.js.meta b/Runtime/wechat-default/check-version.js.meta index f136bb0ca..d51434282 100644 --- a/Runtime/wechat-default/check-version.js.meta +++ b/Runtime/wechat-default/check-version.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 042f851fc2cd2b760f52c343668c5cc8 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 59c0860588a7e28be51c6919dfaf854c + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/data-package.meta b/Runtime/wechat-default/data-package.meta index 45cd5b31b..8ad5cd29f 100644 --- a/Runtime/wechat-default/data-package.meta +++ b/Runtime/wechat-default/data-package.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 67ff1f029018f30663345cd163b89865 +guid: 83e567848cb130003ef0cd51a0b5776e 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 632a9e91d..5e243af11 100644 --- a/Runtime/wechat-default/data-package/game.js.meta +++ b/Runtime/wechat-default/data-package/game.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: b6e2f562aef79212d81c2ba7a7edd3ff -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: f9c962a2bddd74188d1c7b0c3c3ccb6c + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/events.js.meta b/Runtime/wechat-default/events.js.meta index 362c4f72a..89b56e25f 100644 --- a/Runtime/wechat-default/events.js.meta +++ b/Runtime/wechat-default/events.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: c21e4f9445ab1354e004ee6806d36b1c -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 39f79669acebffb769578e26a8e73021 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/game.js.meta b/Runtime/wechat-default/game.js.meta index 7e964beae..79c95307e 100644 --- a/Runtime/wechat-default/game.js.meta +++ b/Runtime/wechat-default/game.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: c4e3d01e4d70fba53c1b8add5d1d79d6 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 4fc2f3d647d1e059d7e9e98e8a71f61e + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/game.json b/Runtime/wechat-default/game.json index a3fd8feea..6adbb3545 100644 --- a/Runtime/wechat-default/game.json +++ b/Runtime/wechat-default/game.json @@ -23,7 +23,7 @@ ], "plugins": { "UnityPlugin": { - "version": "1.2.74", + "version": "1.2.79", "provider": "wxe5a48f1ed5f544b7", "contexts": [ { @@ -32,7 +32,7 @@ ] }, "Layout": { - "version": "1.0.7", + "version": "1.0.16", "provider": "wx7a727ff7d940bb3f", "contexts": [ { diff --git a/Runtime/wechat-default/game.json.meta b/Runtime/wechat-default/game.json.meta index 5a3e54d83..0cc3af51b 100644 --- a/Runtime/wechat-default/game.json.meta +++ b/Runtime/wechat-default/game.json.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: e336f4b63e6dfc217c3b2a4de7b8811b -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 8855516a171c4c3581c4a8964e30a88f + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/images.meta b/Runtime/wechat-default/images.meta index 0f0bb2be8..8f9f8ab80 100644 --- a/Runtime/wechat-default/images.meta +++ b/Runtime/wechat-default/images.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ebace106ae81525b2d597de54b319641 +guid: 5948b7350d6f2d478e7ef36602fdb2b0 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/wechat-default/images/background.jpg.meta b/Runtime/wechat-default/images/background.jpg.meta index bb801cee5..28017f842 100644 --- a/Runtime/wechat-default/images/background.jpg.meta +++ b/Runtime/wechat-default/images/background.jpg.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 961219c24017591be9f7387b32c99dda -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 07d73230d68ed493bc77da4c718aaae4 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/images/unity_logo.png.meta b/Runtime/wechat-default/images/unity_logo.png.meta index b847cb1cb..ca4b418a0 100644 --- a/Runtime/wechat-default/images/unity_logo.png.meta +++ b/Runtime/wechat-default/images/unity_logo.png.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 1512252be1263bff0bad2706fd57721b -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 2d39d9cac5ca9352a3b707992185097e + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/open-data.meta b/Runtime/wechat-default/open-data.meta index 1c9892180..3fda3b0be 100644 --- a/Runtime/wechat-default/open-data.meta +++ b/Runtime/wechat-default/open-data.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9b7a4b7182bc265e1f19186313e10f47 +guid: 64f903afe7940992a79fc094a1d99d70 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/wechat-default/open-data/data.meta b/Runtime/wechat-default/open-data/data.meta index 497d2da76..a349b3464 100644 --- a/Runtime/wechat-default/open-data/data.meta +++ b/Runtime/wechat-default/open-data/data.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 0b8738d6b9bb9fd55482c734e21beb13 +guid: b2ae0bf6e1f3bf096756f07df329ee97 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 78820ff0b..94cb44dca 100644 --- a/Runtime/wechat-default/open-data/data/index.js.meta +++ b/Runtime/wechat-default/open-data/data/index.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 5b2baee358014e8ac3e76cf8b8a2efda -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: db4fec9e0a330e91d98afb3338e7c2e3 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/open-data/data/utils.js.meta b/Runtime/wechat-default/open-data/data/utils.js.meta index fc8a1ff2a..495bd962e 100644 --- a/Runtime/wechat-default/open-data/data/utils.js.meta +++ b/Runtime/wechat-default/open-data/data/utils.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 08c8874633248aebb094108db516d49f -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 363fa516df94061fd9ad0dcc700c39f2 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/open-data/index.js b/Runtime/wechat-default/open-data/index.js index 4aef76b65..82fb2cd6c 100644 --- a/Runtime/wechat-default/open-data/index.js +++ b/Runtime/wechat-default/open-data/index.js @@ -56,7 +56,6 @@ function LayoutWithTplAndStyle(xml, style) { Layout.clear(); Layout.init(xml, style); Layout.layout(sharedContext); - console.log(Layout); } // 仅仅渲染一些提示,比如数据加载中、当前无授权等 function renderTips(tips = '') { diff --git a/Runtime/wechat-default/open-data/index.js.meta b/Runtime/wechat-default/open-data/index.js.meta index 26eb3906d..871b5442a 100644 --- a/Runtime/wechat-default/open-data/index.js.meta +++ b/Runtime/wechat-default/open-data/index.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 0c3f625fe020655264dfb668d2f443af -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 05bf9dbd24a51a83f58816f7becb2d96 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/open-data/loading.js.meta b/Runtime/wechat-default/open-data/loading.js.meta index 91ed9ceaf..88d3cfdea 100644 --- a/Runtime/wechat-default/open-data/loading.js.meta +++ b/Runtime/wechat-default/open-data/loading.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 2dabfccb636244e46ed52391be317a18 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: a37f9ae4cc5d9e86a97ad65fbb3bd61e + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/open-data/render.meta b/Runtime/wechat-default/open-data/render.meta index 802df67c4..227c38e96 100644 --- a/Runtime/wechat-default/open-data/render.meta +++ b/Runtime/wechat-default/open-data/render.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 265b02284af89623aa1b169e677032c8 +guid: c4500c3d69ebe947935f254bf60a7754 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 e1afbc568..c1ef262c6 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: 7ccdb341414889d8b130b75eb976bf93 +guid: 50c196b07f7157d1c6e2b1a3178f311e 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 66871a1f1..cabc2f69a 100644 --- a/Runtime/wechat-default/open-data/render/image/avatar.png.meta +++ b/Runtime/wechat-default/open-data/render/image/avatar.png.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: cee045e37475f34b21d4c1720ef6c0bc -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 36589125b97a0f9f4655edffcbc9d302 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file 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 fabab4d14..5c33af6b6 100644 --- a/Runtime/wechat-default/open-data/render/image/button1.png.meta +++ b/Runtime/wechat-default/open-data/render/image/button1.png.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 6dc42d88f81a82110ca250cfd2e481e5 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 748b753da8585b347b322a470204240a + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file 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 2b07136c3..a36223960 100644 --- a/Runtime/wechat-default/open-data/render/image/button2.png.meta +++ b/Runtime/wechat-default/open-data/render/image/button2.png.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 4487cdaffd527c46b8025027c25a7694 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: ec3c537f028fc1f259700e32087d8b45 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file 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 e8fc8f31e..92e1aa65f 100644 --- a/Runtime/wechat-default/open-data/render/image/button3.png.meta +++ b/Runtime/wechat-default/open-data/render/image/button3.png.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 76041096891fdcca03223685726e2ae1 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 98ed3a88101c6a6d46c39fe03816b6cc + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file 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 97a21bf6a..b5703da40 100644 --- a/Runtime/wechat-default/open-data/render/image/loading.png.meta +++ b/Runtime/wechat-default/open-data/render/image/loading.png.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: b2f5a26d8cab56bc37d9aa5a89adb5a0 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 566263ffd9e07049eb1e5a80f2ca1aa5 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file 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 a5e9ac3d6..f2058bfb6 100644 --- a/Runtime/wechat-default/open-data/render/image/nameBg.png.meta +++ b/Runtime/wechat-default/open-data/render/image/nameBg.png.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 2e3ca9c4c4f2fe83371eaa036575267d -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 1e7bd8e1d6d7dbc7533b696c96cfe46b + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file 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 2953f6f98..1e33e5b70 100644 --- a/Runtime/wechat-default/open-data/render/image/rankAvatar.png.meta +++ b/Runtime/wechat-default/open-data/render/image/rankAvatar.png.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 2ad251d35a6ede2c53d28c11d65588c4 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 0d6b1351235826b8f8b6e47ba52a566d + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file 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 97a52d909..812a6c6a0 100644 --- a/Runtime/wechat-default/open-data/render/image/rankBg.png.meta +++ b/Runtime/wechat-default/open-data/render/image/rankBg.png.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: cc705c8a016fee6d8985e8ba225ce371 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: b4aec397a0e34df6ea71104326b6a48d + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file 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 6e4c85ba7..75f6bfa26 100644 --- a/Runtime/wechat-default/open-data/render/image/shareBg.png.meta +++ b/Runtime/wechat-default/open-data/render/image/shareBg.png.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 5ba45b49351ab15aa5fc8e93e883fa8a -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: b75f1d4cc71b24d519826a5415269994 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file 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 eb37888e5..4a98c302b 100644 --- a/Runtime/wechat-default/open-data/render/image/shareBg2.png.meta +++ b/Runtime/wechat-default/open-data/render/image/shareBg2.png.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 063969bb60d3e53350ddc08fd88643cd -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 3b1833fa3fb34eaaed933114ceb5dc94 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/open-data/render/styles.meta b/Runtime/wechat-default/open-data/render/styles.meta index db87a4b9f..16ef59506 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: 4b8c8b9738cf1d4003d1889eb1bd0535 +guid: aa85e9edf78307db6058731cc22d5c80 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/wechat-default/open-data/render/styles/friendRank.js b/Runtime/wechat-default/open-data/render/styles/friendRank.js index 023c7f523..3c54e216d 100644 --- a/Runtime/wechat-default/open-data/render/styles/friendRank.js +++ b/Runtime/wechat-default/open-data/render/styles/friendRank.js @@ -63,9 +63,10 @@ export default function getStyle(data) { width: data.width * 0.35, height: (data.height / 2 / 3) * 0.4, textAlign: 'center', - lineHeight: (data.height / 2 / 3) * 0.4, + verticalAlign: 'center', fontSize: data.width * 0.043, textOverflow: 'ellipsis', + whiteSpace: 'nowrap', color: '#fff', }, rankScoreTip: { 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 18122a9d5..f9c8db0dd 100644 --- a/Runtime/wechat-default/open-data/render/styles/friendRank.js.meta +++ b/Runtime/wechat-default/open-data/render/styles/friendRank.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 2c6228df96c79548152450bfa2509794 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 745c1a7cea5861ecb2b5622e3c826ca1 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file 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 82b75b05e..b82708c8b 100644 --- a/Runtime/wechat-default/open-data/render/styles/tips.js.meta +++ b/Runtime/wechat-default/open-data/render/styles/tips.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 22e790c7a5b3c7c256fb86627288ec0e -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 0525c85e4491d5bfa2cc6509750052db + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/open-data/render/tpls.meta b/Runtime/wechat-default/open-data/render/tpls.meta index 6d13fe5b0..1adedf8d3 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: c1c61830093508a2c5cc54e5356b0b66 +guid: bb546c2c8d6db7462f85b14ba5b84409 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/wechat-default/open-data/render/tpls/friendRank.js b/Runtime/wechat-default/open-data/render/tpls/friendRank.js index 34b6a65ba..84cacdbda 100644 --- a/Runtime/wechat-default/open-data/render/tpls/friendRank.js +++ b/Runtime/wechat-default/open-data/render/tpls/friendRank.js @@ -1,11 +1,10 @@ /** - * 下面的内容分成两部分,第一部分是一个模板,模板的好处是能够有一定的语法 - * 坏处是模板引擎一般都依赖 new Function 或者 eval 能力,小游戏下面是没有的 - * 所以模板的编译需要在外部完成,可以将注释内的模板贴到下面的页面内,点击 "run"就能够得到编译后的模板函数 - * https://wechat-miniprogram.github.io/minigame-canvas-engine/playground.html - * 如果觉得模板引擎使用过于麻烦,也可以手动拼接字符串,本文件对应函数的目标仅仅是为了创建出 xml 节点数 - */ -/* + * 模板引擎使用教程可见:https://wechat-miniprogram.github.io/minigame-canvas-engine/tutorial/templateengine.html + * xml经过doT.js编译出的模板函数 + * 因为小游戏不支持new Function,模板函数只能外部编译 + * 可直接拷贝本函数到小游戏中使用 + * 原始的模板如下: + * @@ -29,22 +28,17 @@ -*/ -/** - * xml经过doT.js编译出的模板函数 - * 因为小游戏不支持new Function,模板函数只能外部编译 - * 可直接拷贝本函数到小游戏中使用 + + * */ -export default function anonymous(it) { - let out = ' '; - const arr1 = it.data; +export default function tplFunc(it) { + var out = ' '; + var arr1 = it.data; if (arr1) { - let item; - let index = -1; - const l1 = arr1.length - 1; + var item, index = -1, l1 = arr1.length - 1; while (index < l1) { - item = arr1[(index += 1)]; - out += ` `; + item = arr1[index += 1]; + out += ' '; } } out += ' '; 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 7d5cd73b5..bc205267c 100644 --- a/Runtime/wechat-default/open-data/render/tpls/friendRank.js.meta +++ b/Runtime/wechat-default/open-data/render/tpls/friendRank.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 1464cee678f948a7423a81d6594634b5 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 619b996ea76705d86e7ca091f6763108 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file 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 cdc4ec0e7..c30b8073b 100644 --- a/Runtime/wechat-default/open-data/render/tpls/tips.js.meta +++ b/Runtime/wechat-default/open-data/render/tpls/tips.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: d9050cfc8dad50151ceb17d5fae97f24 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 3937445ab0ab507115ec62af717a901e + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/plugin-config.js.meta b/Runtime/wechat-default/plugin-config.js.meta index 6fb74366b..d487aee64 100644 --- a/Runtime/wechat-default/plugin-config.js.meta +++ b/Runtime/wechat-default/plugin-config.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 82221ade2b1cc9ba033f44007e10157f -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 2c201c96fc4504d2ca3744bb72c99b57 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/plugins.meta b/Runtime/wechat-default/plugins.meta index 994203563..c0a7b7ee7 100644 --- a/Runtime/wechat-default/plugins.meta +++ b/Runtime/wechat-default/plugins.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 896f1cfa19eaf326f9f8ab06a1bd27b2 +guid: 427a2390ce7c0b27d5d2cf5de1e64e8c 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 384349d0c..c7c56bc76 100644 --- a/Runtime/wechat-default/plugins/check-update.js.meta +++ b/Runtime/wechat-default/plugins/check-update.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: dcaa80c22cea0bd2b686fff4711070aa -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: e660022866fec8d44e9ad48425a5b4ca + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/plugins/screen-adapter.js.meta b/Runtime/wechat-default/plugins/screen-adapter.js.meta index c581651fc..9c852845e 100644 --- a/Runtime/wechat-default/plugins/screen-adapter.js.meta +++ b/Runtime/wechat-default/plugins/screen-adapter.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 0b672c0d443ee01b75f6c10dcd31034d -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: bc082123ad3cbb57c019c485c9c997d5 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/project.config.json.meta b/Runtime/wechat-default/project.config.json.meta index c23f30e15..9ca649c31 100644 --- a/Runtime/wechat-default/project.config.json.meta +++ b/Runtime/wechat-default/project.config.json.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 1e19fe1dfe018e9f216848b5064fb427 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: ab67930aeb106a00cf7dc38bb4141312 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/texture-config.js.meta b/Runtime/wechat-default/texture-config.js.meta index 03e292fd9..a5ceee523 100644 --- a/Runtime/wechat-default/texture-config.js.meta +++ b/Runtime/wechat-default/texture-config.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: a4fb09ba5fa1d19caa7f943846b127bc -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 818876415ad3c173d528e8094a5a5fd8 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-namespace.js b/Runtime/wechat-default/unity-namespace.js index 30f8347b6..85a15e686 100644 --- a/Runtime/wechat-default/unity-namespace.js +++ b/Runtime/wechat-default/unity-namespace.js @@ -57,6 +57,8 @@ const unityNamespace = { isProfilingBuild: $Is_Profiling_Build, // 预留的堆内存 unityHeapReservedMemory: $UnityHeapReservedMemory, + // 是否向Perfstream上报数据 + sendData2PerfStream: $SEND_DATA_TO_PERF_STREAM, }; // 最佳实践检测配置 unityNamespace.monitorConfig = { diff --git a/Runtime/wechat-default/unity-namespace.js.meta b/Runtime/wechat-default/unity-namespace.js.meta index c639bf9e3..104c0bc89 100644 --- a/Runtime/wechat-default/unity-namespace.js.meta +++ b/Runtime/wechat-default/unity-namespace.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 3a5ae245a6afd3d7090cb78cfe4d4e2a -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 46ed78859da1d3dc72a2605120623465 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk.meta b/Runtime/wechat-default/unity-sdk.meta index 923232395..0a88526fa 100644 --- a/Runtime/wechat-default/unity-sdk.meta +++ b/Runtime/wechat-default/unity-sdk.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4845a80f3a9b7bd00a8bae12864922d6 +guid: eb8e49250dbba3b2d2e745e1b8cde50e folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/wechat-default/unity-sdk/TCPSocket.meta b/Runtime/wechat-default/unity-sdk/TCPSocket.meta index 477b59a98..68a54cf9e 100644 --- a/Runtime/wechat-default/unity-sdk/TCPSocket.meta +++ b/Runtime/wechat-default/unity-sdk/TCPSocket.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 6ffe6010731a471a8ef7824cbac3edbc +guid: 2704a84d8966f7cae5b58fb9bca2bffc 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 b0f44205b..9a20c05cd 100644 --- a/Runtime/wechat-default/unity-sdk/TCPSocket/index.js.meta +++ b/Runtime/wechat-default/unity-sdk/TCPSocket/index.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 64bfcdcddd861d5e78f0a1f42e87a134 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: e085117885dd97b56ad9c92bbe36a743 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/UDPSocket.meta b/Runtime/wechat-default/unity-sdk/UDPSocket.meta index aa14de3c0..03bca7de9 100644 --- a/Runtime/wechat-default/unity-sdk/UDPSocket.meta +++ b/Runtime/wechat-default/unity-sdk/UDPSocket.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: cbf9a4b885f787918aa9ab9a1afab951 +guid: 8c7fe37a90cfdac5d7cdf956e64a5b22 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 1cbb91afa..01a162c0d 100644 --- a/Runtime/wechat-default/unity-sdk/UDPSocket/index.js.meta +++ b/Runtime/wechat-default/unity-sdk/UDPSocket/index.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: f5ced352c617758efe56ddb7984db838 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 43d41ce39d02c38e0806929fa4b17a6c + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/ad.js.meta b/Runtime/wechat-default/unity-sdk/ad.js.meta index 356b7c964..6a4b3a04e 100644 --- a/Runtime/wechat-default/unity-sdk/ad.js.meta +++ b/Runtime/wechat-default/unity-sdk/ad.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 4c40bb52be655d42ba3d42ca5d2d6063 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 75328dcf8c12cf89080771b004ea4830 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/audio.meta b/Runtime/wechat-default/unity-sdk/audio.meta index 7daa23946..8aa88b861 100644 --- a/Runtime/wechat-default/unity-sdk/audio.meta +++ b/Runtime/wechat-default/unity-sdk/audio.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f8d63e23bd27dd4af510331c72556e32 +guid: 4c45abae0e4adf8e1e578d66352976dc 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 ec70048cc..d02564e63 100644 --- a/Runtime/wechat-default/unity-sdk/audio/common.js.meta +++ b/Runtime/wechat-default/unity-sdk/audio/common.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: cb19cb5970e37b07edbe849a8ec6de7b -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: d450eb8d6425416244052e81901d2258 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/audio/const.js.meta b/Runtime/wechat-default/unity-sdk/audio/const.js.meta index e2a7c4147..52b40eb12 100644 --- a/Runtime/wechat-default/unity-sdk/audio/const.js.meta +++ b/Runtime/wechat-default/unity-sdk/audio/const.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 4f492f1a284e456df5f48db43c86ea64 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 0056dc8713de0cf2447447fea5a2dfc0 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/audio/index.js.meta b/Runtime/wechat-default/unity-sdk/audio/index.js.meta index 36cecdef5..6f6b3a088 100644 --- a/Runtime/wechat-default/unity-sdk/audio/index.js.meta +++ b/Runtime/wechat-default/unity-sdk/audio/index.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: ef0b6c3d6b38e9e5512ff929e17e5c26 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 1c8ca0e3ca42b9bd38f3feaa0c2974af + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file 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 6a197b52e..d0a011f38 100644 --- a/Runtime/wechat-default/unity-sdk/audio/inner-audio.js.meta +++ b/Runtime/wechat-default/unity-sdk/audio/inner-audio.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: eb8f641892da31c5cd2930eafe3e463e -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 03036dddd598dc52cea5fea3ba11f1a7 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/audio/store.js.meta b/Runtime/wechat-default/unity-sdk/audio/store.js.meta index b7228c23e..ca2465945 100644 --- a/Runtime/wechat-default/unity-sdk/audio/store.js.meta +++ b/Runtime/wechat-default/unity-sdk/audio/store.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: ace71dabf6aebddf05ccc1f4bb4e81ad -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: dd0663daf945ca85fc11a2961553857e + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file 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 2751db3e1..45092f5ce 100644 --- a/Runtime/wechat-default/unity-sdk/audio/unity-audio.js.meta +++ b/Runtime/wechat-default/unity-sdk/audio/unity-audio.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 57f74f9d33b93f99adf3112e5b556791 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: cb3323957744327997df4c98570892e2 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/audio/utils.js.meta b/Runtime/wechat-default/unity-sdk/audio/utils.js.meta index f983ecdb1..3eb29481c 100644 --- a/Runtime/wechat-default/unity-sdk/audio/utils.js.meta +++ b/Runtime/wechat-default/unity-sdk/audio/utils.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 822d5548bac35dc09162de836bb78b66 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: db1f306961e9b9598a9559c02e01e0ac + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/authorize.js.meta b/Runtime/wechat-default/unity-sdk/authorize.js.meta index 0281bc912..dadad9a84 100644 --- a/Runtime/wechat-default/unity-sdk/authorize.js.meta +++ b/Runtime/wechat-default/unity-sdk/authorize.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 790e62ac559a8c1c2d282282ba18859d -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 286a7f4dd20d2ad97bec3683488c0351 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/bluetooth.meta b/Runtime/wechat-default/unity-sdk/bluetooth.meta index 898b6304e..1b135f970 100644 --- a/Runtime/wechat-default/unity-sdk/bluetooth.meta +++ b/Runtime/wechat-default/unity-sdk/bluetooth.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f524a95057eed2d9d649c69233145d2b +guid: 1a4e63cdf93fb04a89433f381ef11731 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 58781b89d..4694729e4 100644 --- a/Runtime/wechat-default/unity-sdk/bluetooth/index.js.meta +++ b/Runtime/wechat-default/unity-sdk/bluetooth/index.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: c45da990305f18849a0b68791073b1e0 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 2029cc8f12c15668948544338ea100d0 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/camera.js.meta b/Runtime/wechat-default/unity-sdk/camera.js.meta index 344a0175e..de507f660 100644 --- a/Runtime/wechat-default/unity-sdk/camera.js.meta +++ b/Runtime/wechat-default/unity-sdk/camera.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: a06e8687181ef101c26a8c4202785f23 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 22b7d5ddcfc598fb6d06110fd660aed1 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/canvas-context.js.meta b/Runtime/wechat-default/unity-sdk/canvas-context.js.meta index 1e484c7c9..6d5ec6c5a 100644 --- a/Runtime/wechat-default/unity-sdk/canvas-context.js.meta +++ b/Runtime/wechat-default/unity-sdk/canvas-context.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 5d26fa320cef2f051f1d041f8d8b4b0e -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: befc04a5d7760f9e3f83badd4db99f73 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/canvas.js.meta b/Runtime/wechat-default/unity-sdk/canvas.js.meta index 022ac0034..cbc750ad6 100644 --- a/Runtime/wechat-default/unity-sdk/canvas.js.meta +++ b/Runtime/wechat-default/unity-sdk/canvas.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 82063ffc03ef119fe370708a827a4846 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 3064dcb2b829b35891f4678b906ac5b9 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/chat.js.meta b/Runtime/wechat-default/unity-sdk/chat.js.meta index a78924390..651784bad 100644 --- a/Runtime/wechat-default/unity-sdk/chat.js.meta +++ b/Runtime/wechat-default/unity-sdk/chat.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 0f74bb388cb8020878f0b5616f5c7035 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: a300970148729068ba58e721dcad3558 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/cloud.js.meta b/Runtime/wechat-default/unity-sdk/cloud.js.meta index c29ba326c..0ba65c715 100644 --- a/Runtime/wechat-default/unity-sdk/cloud.js.meta +++ b/Runtime/wechat-default/unity-sdk/cloud.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: c9e96880a1fe99e196cb2a44b62aa519 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: a388ed51984471b8f09adc08dcd81d18 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/conf.js.meta b/Runtime/wechat-default/unity-sdk/conf.js.meta index 3121051bf..734473903 100644 --- a/Runtime/wechat-default/unity-sdk/conf.js.meta +++ b/Runtime/wechat-default/unity-sdk/conf.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 73f1e46715728147f018b74878216bf0 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 9cb8255dab6597214a675443d69cc00d + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/file-info.js.meta b/Runtime/wechat-default/unity-sdk/file-info.js.meta index 43120e06f..a1d999697 100644 --- a/Runtime/wechat-default/unity-sdk/file-info.js.meta +++ b/Runtime/wechat-default/unity-sdk/file-info.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 04033f20136baa6bca619baa473be4c2 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 7acc0c60b1dc93a668f369a8c379a007 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/fix.js.meta b/Runtime/wechat-default/unity-sdk/fix.js.meta index 57caab7f1..fc5b1f8c9 100644 --- a/Runtime/wechat-default/unity-sdk/fix.js.meta +++ b/Runtime/wechat-default/unity-sdk/fix.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 46137b09f4eff281394528a27a2baf63 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 23b9565dcb79d3f70166ab4c09dc3c0e + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/font.meta b/Runtime/wechat-default/unity-sdk/font.meta index ebc1e7ca1..e48393a14 100644 --- a/Runtime/wechat-default/unity-sdk/font.meta +++ b/Runtime/wechat-default/unity-sdk/font.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 86c617a045017ddc206b9d23d940b3c0 +guid: 5a4543e13229b9792ccb9b6101370c00 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 ac58cb715..6780ef900 100644 --- a/Runtime/wechat-default/unity-sdk/font/fix-cmap.js.meta +++ b/Runtime/wechat-default/unity-sdk/font/fix-cmap.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 5bc7b6ad1a7a8c6e9adb9c378f7cb85b -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 59e3df9d5396965887dc64c174523e7a + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/font/index.js.meta b/Runtime/wechat-default/unity-sdk/font/index.js.meta index 39feda356..f10116c09 100644 --- a/Runtime/wechat-default/unity-sdk/font/index.js.meta +++ b/Runtime/wechat-default/unity-sdk/font/index.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: b4585586ca60c5a90356229dd2dc97da -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 5ed31c0aac9fd2cf00865e1a3693b999 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file 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 10be69185..56c0045b3 100644 --- a/Runtime/wechat-default/unity-sdk/font/read-metrics.js.meta +++ b/Runtime/wechat-default/unity-sdk/font/read-metrics.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: abae86c57dee77c7254097b5c977ea5f -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 374a8dedfbdda9fdac9d2b6cb24a9731 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file 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 a072e1a51..7deb326d3 100644 --- a/Runtime/wechat-default/unity-sdk/font/split-sc.js.meta +++ b/Runtime/wechat-default/unity-sdk/font/split-sc.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: d4481807d7e40495ba3bed1eb7a4ee55 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: e3e992828a62b60aba99f0ffbbc9e7b5 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/font/util.js.meta b/Runtime/wechat-default/unity-sdk/font/util.js.meta index a4eb61fc3..343c636f0 100644 --- a/Runtime/wechat-default/unity-sdk/font/util.js.meta +++ b/Runtime/wechat-default/unity-sdk/font/util.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 7721d2a2f1e6609f25a1980b50e848c6 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: b3c985edaacdefa0420d58d9af4596a8 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/fs.js.meta b/Runtime/wechat-default/unity-sdk/fs.js.meta index ea7695e3d..9e355efff 100644 --- a/Runtime/wechat-default/unity-sdk/fs.js.meta +++ b/Runtime/wechat-default/unity-sdk/fs.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: d1e5e52be91818598a550c9083a43981 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 4053188079e4b2866cac9a6d5ba1384e + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/game-club.js.meta b/Runtime/wechat-default/unity-sdk/game-club.js.meta index 91712d657..c584f37c3 100644 --- a/Runtime/wechat-default/unity-sdk/game-club.js.meta +++ b/Runtime/wechat-default/unity-sdk/game-club.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: d5d00aed1dfe5812d024d54fea4d63d6 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 72eb600d3c5567d2ff124e12e5892c51 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/game-recorder.js.meta b/Runtime/wechat-default/unity-sdk/game-recorder.js.meta index 18914d4ed..c7982c7e3 100644 --- a/Runtime/wechat-default/unity-sdk/game-recorder.js.meta +++ b/Runtime/wechat-default/unity-sdk/game-recorder.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: b9168f62d0416bda872e08a832c7bd6d -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 9690694c4ac2388805446f7f3c6f417b + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/gyroscope.meta b/Runtime/wechat-default/unity-sdk/gyroscope.meta index a9b6536d7..5a525fe58 100644 --- a/Runtime/wechat-default/unity-sdk/gyroscope.meta +++ b/Runtime/wechat-default/unity-sdk/gyroscope.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d014bb626f02dc1023918589f8a8b058 +guid: e459e7657f373de359e7b5cedaf99f76 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 67f432a3e..5323e5509 100644 --- a/Runtime/wechat-default/unity-sdk/gyroscope/index.js.meta +++ b/Runtime/wechat-default/unity-sdk/gyroscope/index.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 67b6b30c21b7546125fe1bada7befda8 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 3677a7b2c27fab75486b8552d9827fc2 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/index.js.meta b/Runtime/wechat-default/unity-sdk/index.js.meta index cd5a70eb7..70d6be516 100644 --- a/Runtime/wechat-default/unity-sdk/index.js.meta +++ b/Runtime/wechat-default/unity-sdk/index.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: ed2901a54b3c57e970c786fff15b8aef -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: f1097537da823cfc17be45f7cfc2e211 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/logger.js.meta b/Runtime/wechat-default/unity-sdk/logger.js.meta index dd7e4807f..cafed1501 100644 --- a/Runtime/wechat-default/unity-sdk/logger.js.meta +++ b/Runtime/wechat-default/unity-sdk/logger.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: a046b783f70735c944a144d79d23cb43 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 297d8fc7e2ea0c8fc5beed8d524a9a2b + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/mobileKeyboard.meta b/Runtime/wechat-default/unity-sdk/mobileKeyboard.meta index 00c041787..43f2ce88f 100644 --- a/Runtime/wechat-default/unity-sdk/mobileKeyboard.meta +++ b/Runtime/wechat-default/unity-sdk/mobileKeyboard.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 1f7cade30676206bf230a153b13d3b54 +guid: 14b192d6af9ca681900b9087db48c0b5 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 2ec205188..5ffe0c434 100644 --- a/Runtime/wechat-default/unity-sdk/mobileKeyboard/index.js.meta +++ b/Runtime/wechat-default/unity-sdk/mobileKeyboard/index.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: f2dbe5662eec1a5d3053a000aab664d9 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 59c35715f30fa423d2e4c51e3fe43f35 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/module-helper.js.meta b/Runtime/wechat-default/unity-sdk/module-helper.js.meta index dd51fe61c..d16a95bf1 100644 --- a/Runtime/wechat-default/unity-sdk/module-helper.js.meta +++ b/Runtime/wechat-default/unity-sdk/module-helper.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 8bdb575914a0ef1f399792e44e9f4a51 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 2d75bca8de8107b9b54207e1216b3d3e + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/open-data.js.meta b/Runtime/wechat-default/unity-sdk/open-data.js.meta index 752823157..c2cc8cadb 100644 --- a/Runtime/wechat-default/unity-sdk/open-data.js.meta +++ b/Runtime/wechat-default/unity-sdk/open-data.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 8ef9a223b66ee3aee076a7cbd1cdd132 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 1ac73c362ff4d04931d23609d85dc24c + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/recorder.js.meta b/Runtime/wechat-default/unity-sdk/recorder.js.meta index 4ca6c92fb..50b9335ff 100644 --- a/Runtime/wechat-default/unity-sdk/recorder.js.meta +++ b/Runtime/wechat-default/unity-sdk/recorder.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: b9a08203d822434531267797890b5f4b -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 7af8b21b167ed5b48213e1225ae39deb + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/resType.js b/Runtime/wechat-default/unity-sdk/resType.js index fbc6da17c..1cc38b161 100644 --- a/Runtime/wechat-default/unity-sdk/resType.js +++ b/Runtime/wechat-default/unity-sdk/resType.js @@ -233,14 +233,6 @@ export const ResType = { GetLogManagerOption: { level: 'number', }, - LoadOption: { - openlink: 'string', - query: 'object', - }, - ShowOption: { - openlink: 'string', - query: 'object', - }, Path2D: {}, OnCheckForUpdateListenerResult: { hasUpdate: 'bool', diff --git a/Runtime/wechat-default/unity-sdk/resType.js.meta b/Runtime/wechat-default/unity-sdk/resType.js.meta index d13dd9566..ae839f6c5 100644 --- a/Runtime/wechat-default/unity-sdk/resType.js.meta +++ b/Runtime/wechat-default/unity-sdk/resType.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: df9799e5445c91086fc6b878b7487495 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: bed08b6c8ee6eb2670634d6e1ad0f22f + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/resTypeOther.js b/Runtime/wechat-default/unity-sdk/resTypeOther.js index 9ca8b5a42..ead21e383 100644 --- a/Runtime/wechat-default/unity-sdk/resTypeOther.js +++ b/Runtime/wechat-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/wechat-default/unity-sdk/resTypeOther.js.meta b/Runtime/wechat-default/unity-sdk/resTypeOther.js.meta index b27fe707e..01afe14fa 100644 --- a/Runtime/wechat-default/unity-sdk/resTypeOther.js.meta +++ b/Runtime/wechat-default/unity-sdk/resTypeOther.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 875cd938bc789c6ad51ed40d01e427d0 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 5ee8b7c5a147ed635362a23b73f296b9 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/response.js.meta b/Runtime/wechat-default/unity-sdk/response.js.meta index 3c54a44f8..946fc3dfd 100644 --- a/Runtime/wechat-default/unity-sdk/response.js.meta +++ b/Runtime/wechat-default/unity-sdk/response.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: dd4df043e95b2c2bc8be4c11473b4add -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 5c7e7d6ec9ec0bbf53b4f102c15f0f80 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/sdk.js b/Runtime/wechat-default/unity-sdk/sdk.js index d1230f719..0c1957ed6 100644 --- a/Runtime/wechat-default/unity-sdk/sdk.js +++ b/Runtime/wechat-default/unity-sdk/sdk.js @@ -23,7 +23,7 @@ function getClassObject(className, id) { // eslint-disable-next-line @typescript-eslint/naming-convention function WX_OneWayNoFunction(functionName, ...params) { - wx[functionName.replace(/^\w/, a => a.toLowerCase())](...params); + wx[functionName.replace(/^\w/, (a) => a.toLowerCase())](...params); } @@ -33,7 +33,7 @@ const onlyReadyResponse = [ ]; // eslint-disable-next-line @typescript-eslint/naming-convention function WX_SyncFunction(functionName, ...params) { - return wx[functionName.replace(/^\w/, a => a.toLowerCase())](...params); + return wx[functionName.replace(/^\w/, (a) => a.toLowerCase())](...params); } // eslint-disable-next-line @typescript-eslint/naming-convention @@ -42,13 +42,22 @@ function WX_ClassOneWayNoFunction(className, functionName, id, ...params) { if (!obj) { return; } - obj[functionName.replace(/^\w/, a => a.toLowerCase())](...params); + obj[functionName.replace(/^\w/, (a) => a.toLowerCase())](...params); +} +function classFormatAndSend(id, callbackId, callbackName, callbackType, resType, res) { + formatResponse(resType, res); + moduleHelper.send(callbackName, classGetMsg(id, callbackId, callbackType, res)); +} +function classGetMsg(id, callbackId, resType, res) { + return JSON.stringify({ + id, callbackId, type: resType, res: JSON.stringify(res) || '', + }); } export default { WX_OneWayFunction(functionName, successType, failType, completeType, conf, callbackId) { - const lowerFunctionName = functionName.replace(/^\w/, a => a.toLowerCase()); + const lowerFunctionName = functionName.replace(/^\w/, (a) => a.toLowerCase()); const config = formatJsonStr(conf); - + // specialJS if (lowerFunctionName === 'login') { if (!config.timeout) { delete config.timeout; @@ -111,7 +120,7 @@ export default { moduleHelper.send(`_${functionName}Callback`, resStr); }; onEventLists[functionName].push(callback); - wx[functionName.replace(/^\w/, a => a.toLowerCase())](callback); + wx[functionName.replace(/^\w/, (a) => a.toLowerCase())](callback); }, WX_OffEventRegister(functionName) { (onEventLists[functionName] || []).forEach((v) => { @@ -225,7 +234,7 @@ export default { }, WX_SyncFunction_t(functionName, returnType) { const res = WX_SyncFunction(functionName); - if (onlyReadyResponse.includes(functionName.replace(/^\w/, a => a.toLowerCase()))) { + if (onlyReadyResponse.includes(functionName.replace(/^\w/, (a) => a.toLowerCase()))) { formatResponse(returnType, JSON.parse(JSON.stringify(res))); return JSON.stringify(res); } @@ -262,10 +271,10 @@ export default { formatResponse(returnType, res); return JSON.stringify(res); }, - WX_ClassOneWayFunction(functionName, returnType, successType, failType, completeType, conf) { + WX_ClassConstructor(functionName, returnType, successType, failType, completeType, conf) { const config = formatJsonStr(conf); const callbackId = uid(); - const obj = wx[functionName.replace(/^\w/, a => a.toLowerCase())]({ + const obj = wx[functionName.replace(/^\w/, (a) => a.toLowerCase())]({ ...config, success(res) { formatResponse(successType, res); @@ -293,7 +302,7 @@ export default { return callbackId; }, WX_ClassFunction(functionName, returnType, option) { - const obj = wx[functionName.replace(/^\w/, a => a.toLowerCase())](formatJsonStr(option)); + const obj = wx[functionName.replace(/^\w/, (a) => a.toLowerCase())](formatJsonStr(option)); const id = uid(); if (!ClassLists[returnType]) { ClassLists[returnType] = {}; @@ -347,10 +356,10 @@ export default { ClassOnEventLists[className + functionName][id + eventName].push(callback); // WXVideoDecoder OnEvent 不规范 特殊处理 if (className === 'WXVideoDecoder') { - obj[functionName.replace(/^\w/, a => a.toLowerCase())](eventName, callback); + obj[functionName.replace(/^\w/, (a) => a.toLowerCase())](eventName, callback); } else { - obj[functionName.replace(/^\w/, a => a.toLowerCase())](callback); + obj[functionName.replace(/^\w/, (a) => a.toLowerCase())](callback); } }, WX_ClassOffEventFunction(className, functionName, id, eventName) { @@ -389,7 +398,7 @@ export default { if (!obj) { return JSON.stringify(formatResponse(returnType)); } - const res = obj[functionName.replace(/^\w/, a => a.toLowerCase())](); + const res = obj[functionName.replace(/^\w/, (a) => a.toLowerCase())](); return JSON.stringify(formatResponse(returnType, res, id)); }, WX_ClassOneWayNoFunction_vt(className, functionName, id, param1) { @@ -399,4 +408,41 @@ export default { WX_ClassOneWayNoFunction_vn(className, functionName, id, param1) { WX_ClassOneWayNoFunction(className, functionName, id, param1); }, + WX_ClassOneWayFunction(className, functionName, id, successType, failType, completeType, conf, callbackId, usePromise = false) { + + const obj = getClassObject(className, id); + if (!obj) { + return; + } + const lowerFunctionName = functionName.replace(/^\w/, (a) => a.toLowerCase()); + const config = formatJsonStr(conf); + + if (usePromise) { + obj[lowerFunctionName]({ + ...config, + }).then((res) => { + classFormatAndSend(id, callbackId, `_${className}${functionName}Callback`, 'success', successType, res); + }) + .catch((res) => { + classFormatAndSend(id, callbackId, `_${className}${functionName}Callback`, 'fail', failType, res); + }) + .finally((res) => { + classFormatAndSend(id, callbackId, `_${className}${functionName}Callback`, 'complete', completeType, res); + }); + } + else { + obj[lowerFunctionName]({ + ...config, + success(res) { + classFormatAndSend(id, callbackId, `_${className}${functionName}Callback`, 'success', successType, res); + }, + fail(res) { + classFormatAndSend(id, callbackId, `_${className}${functionName}Callback`, 'fail', failType, res); + }, + complete(res) { + classFormatAndSend(id, callbackId, `_${className}${functionName}Callback`, 'complete', completeType, res); + }, + }); + } + }, }; diff --git a/Runtime/wechat-default/unity-sdk/sdk.js.meta b/Runtime/wechat-default/unity-sdk/sdk.js.meta index 139415025..c6a936cf9 100644 --- a/Runtime/wechat-default/unity-sdk/sdk.js.meta +++ b/Runtime/wechat-default/unity-sdk/sdk.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: dc809d75d5108b66ac515841798e279f -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 0b7008f177238cf434df6e32deeb5f84 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/share.js.meta b/Runtime/wechat-default/unity-sdk/share.js.meta index 14fc2973d..4124b373f 100644 --- a/Runtime/wechat-default/unity-sdk/share.js.meta +++ b/Runtime/wechat-default/unity-sdk/share.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 78ae109e9061913cf550c301a34a217d -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 257b38ea117ca6a5818a6d88616e2c92 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/storage.js.meta b/Runtime/wechat-default/unity-sdk/storage.js.meta index 2e15ef372..145d84dc3 100644 --- a/Runtime/wechat-default/unity-sdk/storage.js.meta +++ b/Runtime/wechat-default/unity-sdk/storage.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 02284367da418749fd578a0905129fd0 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: c30b54183e5a20abfc46d5c7b0b8526e + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/texture.js.meta b/Runtime/wechat-default/unity-sdk/texture.js.meta index 1c99affb0..f0996aa78 100644 --- a/Runtime/wechat-default/unity-sdk/texture.js.meta +++ b/Runtime/wechat-default/unity-sdk/texture.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: c547ddbf75d9dd1fee74b99d94b0a983 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: c7948994a4936809e4a2a65924568e24 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/touch.meta b/Runtime/wechat-default/unity-sdk/touch.meta index 0e3897107..1d69bc412 100644 --- a/Runtime/wechat-default/unity-sdk/touch.meta +++ b/Runtime/wechat-default/unity-sdk/touch.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 202f96ea350d2f076a5ccdfbee4a5b3e +guid: 3198756368bf0c7019cf5b34edc841a9 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 3aa47af61..61e082f70 100644 --- a/Runtime/wechat-default/unity-sdk/touch/index.js.meta +++ b/Runtime/wechat-default/unity-sdk/touch/index.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: ab66ec55e851cdcb18487696be4cf046 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 43e86ec23ce127f823cf9c53248d9c5e + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/upload-file.js.meta b/Runtime/wechat-default/unity-sdk/upload-file.js.meta index adaf9468b..8cd27e279 100644 --- a/Runtime/wechat-default/unity-sdk/upload-file.js.meta +++ b/Runtime/wechat-default/unity-sdk/upload-file.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 5290eeccdee639e2b86ebc0d7f596daa -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: e91cbc566f5954a3bea8a506ffec1d9b + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/userinfo.js.meta b/Runtime/wechat-default/unity-sdk/userinfo.js.meta index c1301f368..d437f1588 100644 --- a/Runtime/wechat-default/unity-sdk/userinfo.js.meta +++ b/Runtime/wechat-default/unity-sdk/userinfo.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 0f46bf43d87f88d20c17c0ffabf1908e -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 4df824be7814c3d88bbae4134c568b59 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/util.js.meta b/Runtime/wechat-default/unity-sdk/util.js.meta index 97043a3dc..62d82a8b8 100644 --- a/Runtime/wechat-default/unity-sdk/util.js.meta +++ b/Runtime/wechat-default/unity-sdk/util.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 7725bf07cc472760a4d90dc57bcdbf8e -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: b3e727de0f15c2495becb8a092864953 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/utils.js.meta b/Runtime/wechat-default/unity-sdk/utils.js.meta index e5763d3ff..4a3ea822d 100644 --- a/Runtime/wechat-default/unity-sdk/utils.js.meta +++ b/Runtime/wechat-default/unity-sdk/utils.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: cd5afdff08f5dc063c82c53fb45aa51f -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 10f2e3e74824b096a38c2e2e55e83d85 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/video.js b/Runtime/wechat-default/unity-sdk/video.js index e81be2bbe..53706d8cc 100644 --- a/Runtime/wechat-default/unity-sdk/video.js +++ b/Runtime/wechat-default/unity-sdk/video.js @@ -18,32 +18,27 @@ export default { if (!obj) { return; } - if (key === 'x' || key === 'y' || key === 'width' || key === 'height') { + 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; } - }, - WXVideoPlay(id) { - const obj = getObject(id); - if (!obj) { - return; + 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'; } - 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, - errMsg: key, - position: e && e.position, - buffered: e && e.buffered, - duration: e && e.duration, + type: key, + position: e?.position, + buffered: e?.buffered ? Number(e.buffered) : undefined, + duration: e?.duration, + errMsg: e?.errMsg, })); if (key === 'onError') { GameGlobal.enableTransparentCanvas = false; @@ -51,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/wechat-default/unity-sdk/video.js.meta b/Runtime/wechat-default/unity-sdk/video.js.meta index 40b8b8d4a..395fd81f4 100644 --- a/Runtime/wechat-default/unity-sdk/video.js.meta +++ b/Runtime/wechat-default/unity-sdk/video.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 9f547907240dda24a1f9f0526852c0ab -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 772533fb8d05d7f2cc4e3c81a1eb533c + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/unity-sdk/video.meta b/Runtime/wechat-default/unity-sdk/video.meta index 1dadaf552..963e19b6d 100644 --- a/Runtime/wechat-default/unity-sdk/video.meta +++ b/Runtime/wechat-default/unity-sdk/video.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: e7ebf920036a5b1a457d4f5813c4d258 +guid: ae4d30231a5cfe3d660abaa73c5be170 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/wechat-default/unity-sdk/video/index.js.meta b/Runtime/wechat-default/unity-sdk/video/index.js.meta index edb11bb9b..50c951848 100644 --- a/Runtime/wechat-default/unity-sdk/video/index.js.meta +++ b/Runtime/wechat-default/unity-sdk/video/index.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: f00677605a4285193142ce5ef53974c7 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: a3c4716546cd148eec2e374d19d3c3c4 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/wasmcode.meta b/Runtime/wechat-default/wasmcode.meta index 744b476d1..e87c7b4d9 100644 --- a/Runtime/wechat-default/wasmcode.meta +++ b/Runtime/wechat-default/wasmcode.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 7c7ca23a1466a6ce505afd3a05c887bd +guid: 5bf743811242516c266afbbd3695e97e folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/wechat-default/wasmcode/game.js.meta b/Runtime/wechat-default/wasmcode/game.js.meta index 0b4d13621..94bda8edb 100644 --- a/Runtime/wechat-default/wasmcode/game.js.meta +++ b/Runtime/wechat-default/wasmcode/game.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: daf54c0ec8eaa9a03de044a807a9aacb -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 4d5b2a60771b126db8a3be1be76652df + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/weapp-adapter.js.meta b/Runtime/wechat-default/weapp-adapter.js.meta index a9b69f499..0905525d6 100644 --- a/Runtime/wechat-default/weapp-adapter.js.meta +++ b/Runtime/wechat-default/weapp-adapter.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: a2daf5d17e578c4ac91cd97354d4db86 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 8584a45b105501eebd7df0bf452debc3 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/Runtime/wechat-default/workers.meta b/Runtime/wechat-default/workers.meta index ee64328ed..59e6ddb2a 100644 --- a/Runtime/wechat-default/workers.meta +++ b/Runtime/wechat-default/workers.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: da38964cee74287d125a98bc9fe2b1aa +guid: 6c0dae87b90e76c5bb568c19a5f37277 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Runtime/wechat-default/workers/response.meta b/Runtime/wechat-default/workers/response.meta index 8dbfaa41b..b944ead1d 100644 --- a/Runtime/wechat-default/workers/response.meta +++ b/Runtime/wechat-default/workers/response.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 8a5bcc4fc6f2226c0a609a5c443850c2 +guid: 4b28cb2f0c44eec13c06cba20ee6f36a 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 f788ec0cd..f30dab71a 100644 --- a/Runtime/wechat-default/workers/response/index.js.meta +++ b/Runtime/wechat-default/workers/response/index.js.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: ff874e897193a5be330f72bdd64fb7f7 -DefaultImporter: -externalObjects: {} -userData: -assetBundleName: -assetBundleVariant: \ No newline at end of file + guid: 13a639f9fbf1834ca75d82c2f3143ca4 + DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: \ No newline at end of file diff --git a/WebGLTemplates/WXTemplate/index.html b/WebGLTemplates/WXTemplate/index.html index c0ac2da07..180d4b81e 100644 --- a/WebGLTemplates/WXTemplate/index.html +++ b/WebGLTemplates/WXTemplate/index.html @@ -431,7 +431,7 @@ return ""; }, WX_ClassFunction() {return ""}, - WX_ClassOneWayFunction() {return ""}, + WX_ClassConstructor() {return ""}, WX_ClassSetProperty() {}, WX_ClassOneWayNoFunction_v() {}, WX_ClassOneWayNoFunction_vs() {}, diff --git a/WebGLTemplates/WXTemplate2020/index.html b/WebGLTemplates/WXTemplate2020/index.html index 3c6925cc7..c183a6d96 100644 --- a/WebGLTemplates/WXTemplate2020/index.html +++ b/WebGLTemplates/WXTemplate2020/index.html @@ -503,7 +503,7 @@ return ""; }, WX_ClassFunction() {return ""}, - WX_ClassOneWayFunction() {return ""}, + WX_ClassConstructor() {return ""}, WX_ClassSetProperty() {}, WX_ClassOneWayNoFunction_v() {}, WX_ClassOneWayNoFunction_vs() {}, diff --git a/WebGLTemplates/WXTemplate2022/index.html b/WebGLTemplates/WXTemplate2022/index.html index 1f2a2badf..09c3ae63b 100755 --- a/WebGLTemplates/WXTemplate2022/index.html +++ b/WebGLTemplates/WXTemplate2022/index.html @@ -580,7 +580,7 @@ return ""; }, WX_ClassFunction() {return ""}, - WX_ClassOneWayFunction() {return ""}, + WX_ClassConstructor() {return ""}, WX_ClassSetProperty() {}, WX_ClassOneWayNoFunction_v() {}, WX_ClassOneWayNoFunction_vs() {}, diff --git a/package.json b/package.json index 416564650..650163cc4 100644 --- a/package.json +++ b/package.json @@ -1 +1,14 @@ -{"name":"com.qq.weixin.minigame","displayName":"WXSDK","description":"WeChat Mini Game Tuanjie Engine Adapter SDK Package.","version":"0.1.27","unity":"2019.4","unityRelease":"29f1","keywords":["Tuanjie","WX"],"dependencies":{}} +{ + "name": "com.qq.weixin.minigame", + "displayName": "WXSDK", + "description": "WeChat Mini Game Tuanjie Engine Adapter SDK Package.", + "version": "0.1.1", + "unity": "2019.4", + "unityRelease": "29f1", + "keywords": [ + "Tuanjie", + "WX" + ], + "dependencies": { + } +} \ No newline at end of file