Skip to content

Commit 940d8b6

Browse files
author
nebulaliu
committed
Auto-publish WXSDK.
1 parent 95043af commit 940d8b6

File tree

17 files changed

+206
-120
lines changed

17 files changed

+206
-120
lines changed

CHANGELOG.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,25 @@ Removed - 删除功能/接口
66
Fixed - 修复问题
77
Others - 其他
88
-->
9+
## 2024-3-5 【普通更新】
10+
* 普通:WXAssetBundle支持切换CDN
11+
* 普通:优化VideoPlayer组件
12+
* 普通:更新小游戏模板捕获全局错误
13+
* 普通:高性能+模式不再限制需要iOS>15.0
14+
### Fixed
15+
* 普通:修复wx.onBluetoothDeviceFound
16+
* 普通:修复wx.onUserCaptureScreen
17+
* 普通:修复wx.getAppAuthorizeSetting
18+
* 普通:修复fs.stat
19+
* 普通:修复截屏回调
20+
* 普通:unity21.3网络超时时间设置
21+
922
## 2024-1-18 【普通更新】
10-
包含重要bugfix、特性支持
1123
* 普通:更新适配插件版本到1.2.38
1224
### Fixed
1325
* 普通:不支持WebGL2的旧Android微信版本提供升级指引
1426

1527
## 2024-1-15 【普通更新】
16-
包含重要bugfix、特性支持
1728
### Feature
1829
* 重要:增加iOS高性能+(iOSPerformancePlus)选项,请查阅[高性能+模式](https://developers.weixin.qq.com/minigame/dev/guide/performance/perf-high-performance-plus.html),有助于提升渲染兼容性、降低WebContent进程内存
1930
* 普通:陀螺仪去json性能优化

Editor/WXConvertCore.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ public static WXExportError DoExport(bool buildWebGL = true)
9393
Debug.LogError("若游戏曾使用旧版本微信SDK,需删除 Assets/WX-WASM-SDK 文件夹后再导入最新工具包。");
9494
return WXExportError.BUILD_WEBGL_FAILED;
9595
}
96+
CheckBuildTarget();
9697
Init();
9798
// JSLib
9899
SettingWXTextureMinJSLib();
@@ -159,6 +160,20 @@ public static WXExportError DoExport(bool buildWebGL = true)
159160
return WXExportError.SUCCEED;
160161
}
161162

163+
private static void CheckBuildTarget()
164+
{
165+
if (UnityUtil.GetEngineVersion() == UnityUtil.EngineVersion.Unity)
166+
{
167+
EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.WebGL, BuildTarget.WebGL);
168+
}
169+
else
170+
{
171+
#if TUANJIE_2022_3_OR_NEWER
172+
EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.WeixinMiniGame, BuildTarget.WeixinMiniGame);
173+
#endif
174+
}
175+
}
176+
162177
public static void UpdateGraphicAPI()
163178
{
164179
GraphicsDeviceType[] targets = new GraphicsDeviceType[] { };

Editor/WXPluginVersion.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
public class WXPluginVersion
44
{
5-
public static string pluginVersion = "202401191135"; // 这一行不要改他,导出的时候会自动替换
5+
public static string pluginVersion = "202403051510"; // 这一行不要改他,导出的时候会自动替换
66
}
77

88
public class WXPluginConf

Editor/wx-editor.dll

512 Bytes
Binary file not shown.

Runtime/Plugins/WXAssetBundle.jslib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ var WXAssetBundleLibrary = {
5454
WXFS.fs = wx.getFileSystemManager();
5555
WXFS.nowfd = FS.MAX_OPEN_FDS + 1;
5656
WXFS.isWXAssetBundle = function(url){
57-
if(url.startsWith(GameGlobal.unityNamespace.DATA_CDN)||url.startsWith('/vfs_streamingassets')){
57+
if(WXFS._url2path.has(url)||url.startsWith(GameGlobal.unityNamespace.DATA_CDN)||url.startsWith('/vfs_streamingassets')){
5858
return unityNamespace.isWXAssetBundle(WXFS.url2path(url));
5959
}
6060
return unityNamespace.isWXAssetBundle(url);
0 Bytes
Binary file not shown.

Runtime/Plugins/wx-runtime.dll

0 Bytes
Binary file not shown.

Runtime/wechat-default/check-version.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ const isLibVersionValid = compareVersion(SDKVersion, '2.17.0');
3838
const isH5LibVersionValid = compareVersion(SDKVersion, '2.23.1');
3939
// 压缩纹理需要iOS系统版本>=14.0,检测到不支持压缩纹理时会提示升级系统
4040
const isIOSH5SystemVersionValid = compareVersion(systemVersion, '14.0');
41-
// iOS系统版本>=15支持webgl2
42-
const isIOSWebgl2SystemVersionValid = compareVersion(systemVersion, '15.0');
41+
// iOS系统版本>=15支持webgl2,高性能模式+无此系统要求
42+
const isIOSWebgl2SystemVersionValid = compareVersion(systemVersion, '15.0') || GameGlobal.isIOSHighPerformanceModePlus;
4343
// Android客户端版本>=8.0.19支持webgl2
4444
const isAndroidWebGL2ClientVersionValid = compareVersion(version, '8.0.19');
4545
// 是否用了webgl2

Runtime/wechat-default/game.js

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ checkVersion().then((enable) => {
7979
}).default;
8080
}
8181
catch (error) {
82+
GameGlobal.realtimeLogManager.error(error);
83+
// logManager不支持自动处理错误对象
84+
GameGlobal.logmanager.warn(error.stack);
85+
console.error('requirePlugin:', error);
8286
if (error.message.indexOf('not defined') !== -1) {
8387
console.error('!!!插件需要申请才可使用\n请勿使用测试AppID,并登录 https://mp.weixin.qq.com/ 并前往:能力地图-开发提效包-快适配 开通\n阅读文档获取详情:https://github.com/wechat-miniprogram/minigame-unity-webgl-transform/blob/main/Design/Transform.md');
8488
}
@@ -144,6 +148,7 @@ checkVersion().then((enable) => {
144148
},
145149
});
146150
GameGlobal.managerConfig = managerConfig;
151+
// 显示启动封面
147152
const gameManager = new UnityManager(managerConfig);
148153
gameManager.onLaunchProgress((e) => {
149154
// interface LaunchEvent {
@@ -185,37 +190,19 @@ checkVersion().then((enable) => {
185190
gameManager.assetPath = `${(managerConfig.DATA_CDN || '').replace(/\/$/, '')}/Assets`;
186191
preloadWxCommonFont();
187192
});
188-
// 上报初始化信息
189-
const systeminfo = wx.getSystemInfoSync();
190-
const bootinfo = {
191-
renderer: systeminfo.renderer || '',
192-
isH5Plus: GameGlobal.isIOSHighPerformanceModePlus || false,
193-
abi: systeminfo.abi || '',
194-
brand: systeminfo.brand,
195-
model: systeminfo.model,
196-
platform: systeminfo.platform,
197-
system: systeminfo.system,
198-
version: systeminfo.version,
199-
SDKVersion: systeminfo.SDKVersion,
200-
benchmarkLevel: systeminfo.benchmarkLevel,
201-
};
202-
wx.getRealtimeLogManager().info('game starting', bootinfo);
203-
wx.getLogManager({ level: 0 }).info('game starting', bootinfo);
204-
console.info('game starting', bootinfo);
205-
// 默认上报小游戏实时日志与用户反馈日志(所有error日志+小程序框架异常)
206-
wx.onError((result) => {
207-
gameManager.printErr(result.message);
208-
});
193+
// 插件捕获到引擎错误后,会通过此事件抛给游戏
209194
gameManager.onLogError = function (err) {
210195
GameGlobal.realtimeLogManager.error(err);
211-
GameGlobal.logmanager.warn(err);
196+
const isErrorObj = err && err.stack;
197+
GameGlobal.logmanager.warn(isErrorObj ? err.stack : err);
212198
};
213199
// iOS高性能模式定期GC
214200
if (GameGlobal.canUseiOSAutoGC && unityNamespace.iOSAutoGCInterval !== 0) {
215201
setInterval(() => {
216202
wx.triggerGC();
217203
}, unityNamespace.iOSAutoGCInterval);
218204
}
205+
// 开始执行游戏启动流程
219206
gameManager.startGame();
220207
GameGlobal.manager = gameManager;
221208
GameGlobal.events.on('launchOperaPushMsgToWasm', (callback, args) => GameGlobal.WXWASMSDK.WXLaunchOperaBridgeToC(callback, args));

Runtime/wechat-default/game.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
],
2424
"plugins": {
2525
"UnityPlugin": {
26-
"version": "1.2.39",
26+
"version": "1.2.41",
2727
"provider": "wxe5a48f1ed5f544b7",
2828
"contexts": [
2929
{

0 commit comments

Comments
 (0)