diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b5ce78e..1246efa2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ Removed - 删除功能/接口 Fixed - 修复问题 Others - 其他 --> +## 2024-4-26 【普通更新】 +### Fixed +* 普通:修复Unity2018/2019的兼容 +* 普通:兼容Windows 1.0.4版本template问题 +* 普通:修复Android平台导出时的 + ## 2024-4-17 【普通更新】 ### Feature * 普通:编译参数增加ERROR_ON_UNDEFINED_SYMBOLS diff --git a/Editor/WXConvertCore.cs b/Editor/WXConvertCore.cs index 95c1b8bb..20c9bd76 100644 --- a/Editor/WXConvertCore.cs +++ b/Editor/WXConvertCore.cs @@ -18,12 +18,11 @@ namespace WeChatWASM static WXConvertCore() { - Init(); + // Init(); } public static void Init() { - //config = UnityUtil.GetEditorConf(); SDKFilePath = Path.Combine(UnityUtil.GetWxSDKRootPath(), "Runtime", "wechat-default", "unity-sdk", "index.js"); string templateHeader = "PROJECT:"; #if TUANJIE_2022_3_OR_NEWER diff --git a/Editor/WXExtDef.cs b/Editor/WXExtDef.cs index 8dd25f71..81075904 100644 --- a/Editor/WXExtDef.cs +++ b/Editor/WXExtDef.cs @@ -1,5 +1,6 @@ using System.Collections; using System.Collections.Generic; +using System.IO; using UnityEngine; using UnityEditor; using UnityEditor.Build; @@ -109,6 +110,36 @@ namespace WeChatWASM { return WXConvertCore.UseIL2CPP; }); + WXExtEnvDef.RegisterAction("UnityUtil.GetWxSDKRootPath", (args) => { +#if UNITY_2018 + return Path.Combine(Application.dataPath, "WX-WASM-SDK-V2"); +#else + var packageInfo = UnityEditor.PackageManager.PackageInfo.FindForAssembly(typeof(WXExtEnvDef).Assembly); + if (packageInfo == null) + { + return Path.Combine(Application.dataPath, "WX-WASM-SDK-V2"); + } + string packagePath = packageInfo.assetPath; + if (packageInfo.name == "WXSDK") + { + packagePath += "/Resources"; + } + DirectoryInfo dir = new DirectoryInfo(packagePath); + return dir.FullName; +#endif + }); + WXExtEnvDef.RegisterAction("UnityUtil.IsAssets", (args) => { +#if UNITY_2018 + return true; +#else + var packageInfo = UnityEditor.PackageManager.PackageInfo.FindForAssembly(typeof(WXExtEnvDef).Assembly); + if (packageInfo == null) + { + return true; + } + return false; +#endif + }); } } } \ No newline at end of file diff --git a/Editor/WXPluginVersion.cs b/Editor/WXPluginVersion.cs index f17b2a04..c59ae77b 100644 --- a/Editor/WXPluginVersion.cs +++ b/Editor/WXPluginVersion.cs @@ -2,7 +2,7 @@ { public class WXPluginVersion { - public static string pluginVersion = "202404171424"; // 这一行不要改他,导出的时候会自动替换 + public static string pluginVersion = "202404261957"; // 这一行不要改他,导出的时候会自动替换 } public class WXPluginConf diff --git a/Editor/wx-editor.dll b/Editor/wx-editor.dll index 2f1f4d3d..0f2ab2ba 100644 Binary files a/Editor/wx-editor.dll and b/Editor/wx-editor.dll differ diff --git a/Runtime/Plugins/wx-runtime-editor.dll b/Runtime/Plugins/wx-runtime-editor.dll index 97db7867..dbec6ffe 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.dll.meta b/Runtime/Plugins/wx-runtime-editor.dll.meta index bd5c279c..5b92c445 100644 --- a/Runtime/Plugins/wx-runtime-editor.dll.meta +++ b/Runtime/Plugins/wx-runtime-editor.dll.meta @@ -12,7 +12,7 @@ PluginImporter: validateReferences: 1 platformData: - first: - : Any + '': Any second: enabled: 0 settings: @@ -60,7 +60,7 @@ PluginImporter: second: enabled: 0 settings: - CPU: AnyCPU + CPU: x86_64 - first: Standalone: LinuxUniversal second: diff --git a/Runtime/Plugins/wx-runtime.dll b/Runtime/Plugins/wx-runtime.dll index b85ae502..78317658 100644 Binary files a/Runtime/Plugins/wx-runtime.dll and b/Runtime/Plugins/wx-runtime.dll differ diff --git a/Runtime/Plugins/wx-runtime.dll.meta b/Runtime/Plugins/wx-runtime.dll.meta index 3755ff2f..fda9103d 100644 --- a/Runtime/Plugins/wx-runtime.dll.meta +++ b/Runtime/Plugins/wx-runtime.dll.meta @@ -12,7 +12,7 @@ PluginImporter: validateReferences: 1 platformData: - first: - : Any + '': Any second: enabled: 0 settings: @@ -61,7 +61,7 @@ PluginImporter: second: enabled: 0 settings: - CPU: AnyCPU + CPU: x86_64 - first: Standalone: LinuxUniversal second: @@ -91,11 +91,6 @@ PluginImporter: second: enabled: 1 settings: {} - - first: - WeixinMiniGame: WeixinMiniGame - second: - enabled: 1 - settings: {} - first: Windows Store Apps: WindowsStoreApps second: diff --git a/Runtime/WebAES.cs b/Runtime/WebAES.cs index bfe0dcd5..d6389dfb 100644 --- a/Runtime/WebAES.cs +++ b/Runtime/WebAES.cs @@ -1,4 +1,5 @@ -using System.Runtime.InteropServices; +#if UNITY_WEBGL || WEIXINMINIGAME || UNITY_EDITOR +using System.Runtime.InteropServices; using System.Security.Cryptography; using System.Text; using AOT; @@ -105,4 +106,5 @@ namespace WeChatWASM return Encoding.UTF8.GetString(DecryptedBytes); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/Runtime/WebMD5.cs b/Runtime/WebMD5.cs index f819c6e9..006c9799 100644 --- a/Runtime/WebMD5.cs +++ b/Runtime/WebMD5.cs @@ -1,4 +1,5 @@ -using System; +#if UNITY_WEBGL || WEIXINMINIGAME || UNITY_EDITOR +using System; using System.Runtime.InteropServices; namespace WeChatWASM @@ -28,4 +29,5 @@ namespace WeChatWASM return result; } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/package.json b/package.json index 36a4e420..f156d7de 100644 --- a/package.json +++ b/package.json @@ -1 +1 @@ -{"name":"com.qq.weixin.minigame","displayName":"WXSDK","description":"WeChat Mini Game Tuanjie Engine Adapter SDK Package.","version":"0.1.8","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.9","unity":"2019.4","unityRelease":"29f1","keywords":["Tuanjie","WX"],"dependencies":{}}