Skip to content

Commit e94d418

Browse files
committed
[同步]1. 同步最新的插件
1 parent b98ec2b commit e94d418

File tree

179 files changed

+15683
-7615
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+15683
-7615
lines changed

CHANGELOG.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,73 @@ Removed - 删除功能/接口
66
Fixed - 修复问题
77
Others - 其他
88
-->
9+
## 2024-12-25 【预发布】
10+
PackageManager(git URL): https://github.com/wechat-miniprogram/minigame-tuanjie-transform-sdk.git#pre-v0.1.24
11+
### Feature
12+
* 普通: OffShareMessageToFriend支持
13+
### Fixed
14+
* 普通: reserveChannelsLive补充回调参数
15+
* 普通: 低基础库版本报错修复
16+
* 普通: BannerAd.OnResize回调报错修复
17+
* 普通: requestMidasPaymentGameItem修复
18+
* 普通: WriteSync接口无法正常返回已写入的字节数
19+
* 普通: ReadSync接口无法正常调用
20+
21+
## 2024-12-18 【重要更新】
22+
### Feature
23+
* 普通: 开放数据域支持screenCanvas
24+
* 普通: 完善screenCanvas.toTempFilePath
25+
* 普通: 低版本WindowInfo适配
26+
* 普通: 调整autoAdaptScreen默认false
27+
* 普通: 首资源包放小游戏分包时,总大小调整为30MB
28+
### Fixed
29+
* 重要: 更改WebGLInput.mobileKeyboardSupport默认属性为 false,该属性导致Unity2022 以上版本 Touch 会多调用一次 MainLoop产生较大性能损耗。请使用微信键盘API或 WXTouchInputOverride支持文本输入框
30+
31+
## 2024-11-14 【普通更新】
32+
### Feature
33+
* 普通: WXSDK代码简化
34+
* 普通: 增强JsonMapper报错信息
35+
* 普通: 适配插件版本升级到1.2.62
36+
### Fixed
37+
* 普通: WX.Cloud.Init 自定义环境报错
38+
39+
## 2024-10-8 【重要更新】
40+
### Feature
41+
* 普通: UDPSocket.write适配
42+
* 普通: 部分JS API接口更新
43+
* 普通: 云开发/云托管支持
44+
### Fixed
45+
* 普通: 修复.net8 OnApplicationFocus/Pause适配
46+
* 普通: 修复插件自动调节dpr后,获取不到实际dpr
47+
* 普通:修复音频设置timeSamples不生效
48+
* 重要: 修复iOS18微信系统字体丢失
49+
* 重要:修复10S17.5以上音频退后台无法恢复
50+
* 重要:修复音频PC端异常循环播
51+
* 重要: 修复游戏圈文案默认显示'打开游戏圈'的问题
52+
53+
## 2024-8-13 【重要更新】
54+
### Feature
55+
* 普通: 横竖屏切换,PC窗口大小自动适配
56+
* 普通: PC分辨率模糊,自动调节dpr属性
57+
### Fixed
58+
* 严重:修复多点触控产生的异常
59+
* 普通:适配2021,去_JS_Focus_Window
60+
* 普通:修复多线程压缩的扩展名判定
61+
62+
## 2024-7-09 【普通更新】
63+
### Feature
64+
* 普通:兼容2022新增的音频API
65+
* 普通:更快的转换打包速度
66+
* 普通:Unity侧添加设置分辨率接口
67+
### Fixed
68+
* 普通:临时兼容wk 17.5暂停音频无法恢复的bug
69+
* 普通:Touch id在特定情况丢失
70+
* 普通:使用微信压缩纹理工具sprite atlas版本被修改
71+
72+
## 2024-5-17 【普通更新】
73+
Fixed
74+
* 普通:修复WXAssetBundle与预下载冲突问题
75+
976
## 2024-5-15 【普通更新】
1077
### Feature
1178
* 普通:支持JS构建模板,请查阅[模板文档](https://wechat-miniprogram.github.io/minigame-unity-webgl-transform/Design/BuildTemplate.html)

Editor/WXAssetPostprocessor.cs

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
using UnityEditor;
2+
using System;
3+
using System.Reflection;
4+
using System.IO;
5+
/*
6+
public class WXAssetPostprocessor : AssetPostprocessor
7+
{
8+
private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
9+
{
10+
foreach (string asset in importedAssets)
11+
{
12+
ProcessWxPerfPluginAsset(asset);
13+
}
14+
}
15+
16+
public static bool EnableWXPostProcess = false;
17+
18+
static void ProcessWxPerfPluginAsset(string wxPerfPluginAsset)
19+
{
20+
PluginImporter importer = AssetImporter.GetAtPath(wxPerfPluginAsset) as PluginImporter;
21+
if (importer == null) return;
22+
23+
// 判断是否是wx_perf_2022.a/o文件
24+
if (wxPerfPluginAsset.Contains("wx_perf_2022.a"))
25+
{
26+
if (IsCompatibleWithUnity202203OrNewer() && EnableWXPostProcess)
27+
{
28+
#if PLATFORM_WEIXINMINIGAME
29+
if (importer.GetCompatibleWithPlatform(BuildTarget.WeixinMiniGame))
30+
#else
31+
if (importer.GetCompatibleWithPlatform(BuildTarget.WebGL))
32+
#endif
33+
{
34+
return;
35+
}
36+
EnablePluginAsset(wxPerfPluginAsset);
37+
AssetDatabase.Refresh();
38+
}
39+
else
40+
{
41+
RemovePluginAssetAllCompatibility(wxPerfPluginAsset);
42+
}
43+
44+
return;
45+
}
46+
47+
48+
// 判断是否是wx_perf_2021.a/o文件
49+
if (wxPerfPluginAsset.Contains("wx_perf_2021.a"))
50+
{
51+
if (IsCompatibleWithUnity202103To202203() && EnableWXPostProcess)
52+
{
53+
// UnityEngine.Debug.Log($"Before --- WebGL: {importer.GetCompatibleWithPlatform(BuildTarget.WebGL)}, Editor: {importer.GetCompatibleWithEditor()}");
54+
#if PLATFORM_WEIXINMINIGAME
55+
if (importer.GetCompatibleWithPlatform(BuildTarget.WeixinMiniGame))
56+
#else
57+
if (importer.GetCompatibleWithPlatform(BuildTarget.WebGL))
58+
#endif
59+
{
60+
return;
61+
}
62+
63+
EnablePluginAsset(wxPerfPluginAsset);
64+
// UnityEngine.Debug.Log($"After --- WebGL: {importer.GetCompatibleWithPlatform(BuildTarget.WebGL)}, Editor: {importer.GetCompatibleWithEditor()}");
65+
66+
AssetDatabase.Refresh();
67+
}
68+
else
69+
{
70+
RemovePluginAssetAllCompatibility(wxPerfPluginAsset);
71+
}
72+
73+
return;
74+
}
75+
76+
if (wxPerfPluginAsset.Contains("WxPerfJsBridge.jslib"))
77+
{
78+
if (EnableWXPostProcess)
79+
{
80+
// UnityEngine.Debug.Log($"Before --- WebGL: {importer.GetCompatibleWithPlatform(BuildTarget.WebGL)}, Editor: {importer.GetCompatibleWithEditor()}");
81+
#if PLATFORM_WEIXINMINIGAME
82+
if (importer.GetCompatibleWithPlatform(BuildTarget.WeixinMiniGame))
83+
#else
84+
if (importer.GetCompatibleWithPlatform(BuildTarget.WebGL))
85+
#endif
86+
{
87+
return;
88+
}
89+
90+
EnablePluginAsset(wxPerfPluginAsset);
91+
// UnityEngine.Debug.Log($"After --- WebGL: {importer.GetCompatibleWithPlatform(BuildTarget.WebGL)}, Editor: {importer.GetCompatibleWithEditor()}");
92+
93+
AssetDatabase.Refresh();
94+
}
95+
else
96+
{
97+
RemovePluginAssetAllCompatibility(wxPerfPluginAsset);
98+
}
99+
100+
return;
101+
}
102+
103+
104+
105+
}
106+
107+
static bool IsCompatibleWithUnity202203OrNewer()
108+
{
109+
#if UNITY_2022_3_OR_NEWER
110+
return true;
111+
#endif
112+
return false;
113+
}
114+
115+
static bool IsCompatibleWithUnity202103To202203()
116+
{
117+
#if UNITY_2022_3_OR_NEWER
118+
return false;
119+
#endif
120+
121+
#if !UNITY_2021_3_OR_NEWER
122+
return false;
123+
#endif
124+
125+
return true;
126+
}
127+
128+
129+
private static void RemovePluginAssetAllCompatibility(string inAssetPath)
130+
{
131+
PluginImporter importer = AssetImporter.GetAtPath(inAssetPath) as PluginImporter;
132+
133+
#if PLATFORM_WEIXINMINIGAME
134+
importer.SetCompatibleWithPlatform(BuildTarget.WeixinMiniGame, false);
135+
#else
136+
importer.SetCompatibleWithPlatform(BuildTarget.WebGL, false);
137+
#endif
138+
139+
AssetDatabase.WriteImportSettingsIfDirty(inAssetPath);
140+
}
141+
142+
private static bool IsPluginAssetValid(PluginImporter inPluginImporter)
143+
{
144+
if (inPluginImporter == null) return false;
145+
146+
if (inPluginImporter.GetCompatibleWithEditor()) return true;
147+
148+
foreach (BuildTarget target in Enum.GetValues(typeof(BuildTarget)))
149+
{
150+
if (inPluginImporter.GetCompatibleWithPlatform(target))
151+
{
152+
return true;
153+
}
154+
}
155+
156+
return false;
157+
}
158+
159+
private static void EnablePluginAsset(string inAssetPath)
160+
{
161+
PluginImporter importer = AssetImporter.GetAtPath(inAssetPath) as PluginImporter;
162+
#if PLATFORM_WEIXINMINIGAME
163+
importer.SetCompatibleWithPlatform(BuildTarget.WeixinMiniGame, EnableWXPostProcess);
164+
#else
165+
importer.SetCompatibleWithPlatform(BuildTarget.WebGL, EnableWXPostProcess);
166+
#endif
167+
AssetDatabase.WriteImportSettingsIfDirty(inAssetPath);
168+
}
169+
170+
private static int GetEnabledFlagStringIndex(string inAllText, string inTagStr)
171+
{
172+
int tagStrIdx = inAllText.IndexOf(inTagStr);
173+
174+
int enabledStrIdx = inAllText.IndexOf("enabled: ", tagStrIdx);
175+
176+
// inAllText[enabledStrIdx] == 'e'
177+
// And that is to say, inAllText[enabledStrIdx + 9] should be 0 or 1
178+
return enabledStrIdx + 9;
179+
}
180+
}
181+
*/

Editor/WXAssetPostprocessor.cs.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)