Skip to content

Commit 9290bb0

Browse files
author
uhu
committed
Merge branch 'main' into feat/screenCanvas
# Conflicts: # Demo/Ranking/Assets/RankDemo/Ranking.cs
2 parents b8016c0 + d8f4400 commit 9290bb0

File tree

786 files changed

+146901
-96723
lines changed

Some content is hidden

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

786 files changed

+146901
-96723
lines changed

.config/.vitepress/config.mts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export default defineConfig({
3535
{ text: "简介", link: "/README" },
3636
{ text: "安装与使用", link: "/Design/SDKInstaller" },
3737
{ text: "入门指南", link: "/Design/Guide" },
38+
{ text: "快速开始", link: "/Design/Transform" },
3839
{ text: "优秀案例", link: "/Design/ShowCase" },
3940
{ text: "更新日志", link: "/CHANGELOG.md" },
4041
],
@@ -133,6 +134,7 @@ export default defineConfig({
133134
text: "能力适配",
134135
items: [
135136
{ text: "WX SDK 平台能力适配", link: "/Design/WX_SDK" },
137+
{ text: "音频视频适配", link: "/Design/AudioAndVideo" },
136138
{ text: "屏幕适配", link: "/Design/fixScreen" },
137139
{ text: "输入法适配", link: "/Design/InputAdaptation" },
138140
{ text: "排行榜与微信关系数据", link: "/Design/OpenData" },

.config/dotnet-tools.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"csharpier": {
6+
"version": "0.28.2",
7+
"commands": [
8+
"dotnet-csharpier"
9+
],
10+
"rollForward": false
11+
}
12+
}
13+
}

.editorconfig

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Remove the line below if you want to inherit .editorconfig settings from higher directories
2+
root = true
3+
4+
#### Core EditorConfig Options ####
5+
6+
[*]
7+
# Indentation and spacing: https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties
8+
indent_style = space
9+
indent_size = 4
10+
end_of_line = crlf
11+
charset = utf-8
12+
trim_trailing_whitespace = true
13+
insert_final_newline = false
14+
15+
# C# files
16+
[*.cs]
17+
# C# formatting options: https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/csharp-formatting-options
18+
csharp_new_line_before_open_brace = all
19+
csharp_new_line_before_else = true
20+
csharp_new_line_before_catch = true
21+
csharp_new_line_before_finally = true
22+
csharp_new_line_before_members_in_object_initializers = true
23+
csharp_new_line_before_members_in_anonymous_types = true
24+
csharp_new_line_between_query_expression_clauses = true
25+
26+
#### .NET Coding Conventions ####
27+
28+
# this. and Me. preferences
29+
dotnet_style_qualification_for_method = true
30+
31+
#### Diagnostic configuration ####
32+
33+
# CA1000: Do not declare static members on generic types
34+
dotnet_diagnostic.CA1000.severity = warning

CHANGELOG.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,34 @@ SDK安装指引:[微信小游戏Unity、团结引擎转换插件WXSDK](Design/
1111
1. UnityPackage:[下载地址](https://game.weixin.qq.com/cgi-bin/gamewxagwasmsplitwap/getunityplugininfo?download=1)
1212
2. PackageManager(git URL): https://github.com/wechat-miniprogram/minigame-tuanjie-transform-sdk.git
1313

14-
## 2024-7-31 【预发布】
15-
PackageManager(git URL): https://github.com/wechat-miniprogram/minigame-tuanjie-transform-sdk.git#pre-v0.1.18
14+
## 2024-10-18 【预发布】
15+
PackageManager(git URL): https://github.com/wechat-miniprogram/minigame-tuanjie-transform-sdk.git#pre-v0.1.22
16+
### Feature
17+
* 普通: WXSDK代码简化
18+
* 普通: 增强JsonMapper报错信息
19+
### Fixed
20+
* 普通: WX.Cloud.Init() 自定义环境报错
21+
22+
## 2024-10-8 【重要更新】
23+
### Feature
24+
* 普通: UDPSocket.write适配
25+
* 普通: 部分JS API接口更新
26+
* 普通: 云开发/云托管支持
27+
### Fixed
28+
* 普通: 修复.net8 OnApplicationFocus/Pause适配
29+
* 普通: 修复插件自动调节dpr后,获取不到实际dpr
30+
* 普通: 修复音频设置timeSamples不生效
31+
* 重要: 修复iOS18微信系统字体丢失
32+
* 重要: 修复iOS17.5以上音频退后台无法恢复
33+
* 重要: 修复音频PC端异常循环播放
34+
* 重要: 修复游戏圈文案默认显示'打开游戏圈'的问题
35+
36+
## 2024-8-13 【重要更新】
1637
### Feature
1738
* 普通: 横竖屏切换,PC窗口大小自动适配
39+
* 普通: PC分辨率模糊,自动调节dpr属性
1840
### Fixed
19-
* 严重:修复多点触控异常
41+
* 严重:修复多点触控产生的异常
2042
* 普通:适配2021,去_JS_Focus_Window
2143
* 普通:修复多线程压缩的扩展名判定
2244

Demo/API_V2/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,7 @@ crashlytics-build.properties
8383

8484
# Idea
8585
.idea/
86+
87+
.vscode/
88+
wxbuild/
89+
wxbuild2/

Demo/API_V2/Assets/API/APISO.asset

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ MonoBehaviour:
1616
- {fileID: 11400000, guid: 587fe4b03da9d44779ac921ffdb216a7, type: 2}
1717
- {fileID: 11400000, guid: 82450cc74b3b4439da53b9f0f2298454, type: 2}
1818
- {fileID: 11400000, guid: b34629c67a7664a428561dd0b3621995, type: 2}
19+
- {fileID: 11400000, guid: 24d9eba5a9b3048b59cf7e5495bb999d, type: 2}
1920
- {fileID: 11400000, guid: 9977a581037b84833a32b508e00eb1a2, type: 2}
2021
- {fileID: 11400000, guid: 56f316e0e10ba419bbf19bd7a68bfc4c, type: 2}
2122
- {fileID: 11400000, guid: 6f0972f5fdc56c543b23c9873d760bf5, type: 2}
22-
- {fileID: 11400000, guid: 7ef06699cee7846b7823e4cc421418eb, type: 2}
2323
- {fileID: 11400000, guid: a461b8cd70d9e4e23ad1cc953bec31e9, type: 2}
24+
- {fileID: 11400000, guid: 7ef06699cee7846b7823e4cc421418eb, type: 2}
2425
- {fileID: 11400000, guid: 55de20d536f8c4689bbd80553d87fe46, type: 2}
2526
- {fileID: 11400000, guid: f2c56d751bb7c4c398db7c1db352517d, type: 2}
2627
- {fileID: 11400000, guid: b4a6196f623dd4435a4f3bd70af92d06, type: 2}
@@ -36,3 +37,4 @@ MonoBehaviour:
3637
- {fileID: 11400000, guid: 1aa518b2f8ca04c6e81821bcb9a3cc49, type: 2}
3738
- {fileID: 11400000, guid: 89339dab17a614cbf8abc8469d67cb72, type: 2}
3839
- {fileID: 11400000, guid: 27654a238f98e4f7e8756e4caed418e1, type: 2}
40+
- {fileID: 11400000, guid: ebd496025e81f434bb6b5b487cfbf2ed, type: 2}

Demo/API_V2/Assets/API/Ad/AdWithAudio/AdWithAudio.cs

Lines changed: 39 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,33 @@
1-
using UnityEngine;
2-
using WeChatWASM;
3-
using UnityEngine.UI;
4-
using UnityEngine.Networking;
51
using System;
62
using System.Collections;
7-
using System.Collections.Generic;
8-
9-
using UnityEngine.Audio;
3+
using UnityEngine;
104
using UnityEngine.Networking;
5+
using WeChatWASM;
116

127
public class AdWithAudio : Details
138
{
14-
159
private WXRewardedVideoAd _rewardedVideoAd;
1610
public AudioSource audioSource;
1711
public AudioClip audioClipCDN;
18-
12+
1913
private void Start()
2014
{
2115
StartCoroutine(LoadCDNAudio());
2216

23-
2417
// 创建激励视频广告组件
25-
_rewardedVideoAd = WX.CreateRewardedVideoAd(new WXCreateRewardedVideoAdParam()
18+
_rewardedVideoAd = WX.CreateRewardedVideoAd(
19+
new WXCreateRewardedVideoAdParam()
20+
{
21+
// adUnitId 请填写自己的广告位 ID
22+
adUnitId = "adunit-881d549c5a14a7e3"
23+
}
24+
);
25+
26+
_rewardedVideoAd.OnError(err =>
2627
{
27-
// adUnitId 请填写自己的广告位 ID
28-
adUnitId = "adunit-881d549c5a14a7e3"
29-
});
30-
31-
_rewardedVideoAd.OnError(err => {
3228
Debug.Log(JsonUtility.ToJson(err));
3329
});
34-
30+
3531
GameManager.Instance.detailsController.BindExtraButtonAction(0, PlayCDN);
3632
}
3733

@@ -49,7 +45,8 @@ IEnumerator LoadCDNAudio()
4945
// 添加 AudioSource 组件
5046
audioSource = newGameObject.AddComponent<AudioSource>();
5147

52-
string uriString = "https://res.wx.qq.com/wechatgame/product/webpack/userupload/20220901/211827/CallMeTeenTop.mp3";
48+
string uriString =
49+
"https://res.wx.qq.com/wechatgame/product/webpack/userupload/20220901/211827/CallMeTeenTop.mp3";
5350
Uri uri = new Uri(uriString);
5451
UnityWebRequest request = UnityWebRequestMultimedia.GetAudioClip(uri, AudioType.MPEG);
5552
yield return request.SendWebRequest();
@@ -78,25 +75,35 @@ public void PlayCDN()
7875
// 展示广告
7976
private void ShowAd()
8077
{
81-
_rewardedVideoAd.Show(res => {
82-
Debug.Log("Show success");
83-
Debug.Log(JsonUtility.ToJson(res));
84-
}, err => {
85-
Debug.Log(JsonUtility.ToJson(err));
86-
_rewardedVideoAd.Load(res => {
87-
Debug.Log("load success");
88-
_rewardedVideoAd.Show();
89-
}, err => {
90-
Debug.Log("load fail");
78+
_rewardedVideoAd.Show(
79+
res =>
80+
{
81+
Debug.Log("Show success");
82+
Debug.Log(JsonUtility.ToJson(res));
83+
},
84+
err =>
85+
{
9186
Debug.Log(JsonUtility.ToJson(err));
92-
});
93-
});
87+
_rewardedVideoAd.Load(
88+
res =>
89+
{
90+
Debug.Log("load success");
91+
_rewardedVideoAd.Show();
92+
},
93+
err =>
94+
{
95+
Debug.Log("load fail");
96+
Debug.Log(JsonUtility.ToJson(err));
97+
}
98+
);
99+
}
100+
);
94101
}
95-
96102

97103
public void Destroy()
98104
{
99-
if (audioSource != null) {
105+
if (audioSource != null)
106+
{
100107
audioSource.clip = null;
101108
audioSource = null;
102109
}

Demo/API_V2/Assets/API/Ad/BannerAd/BannerAd.cs

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
using UnityEngine;
1+
using UnityEngine;
22
using WeChatWASM;
33

44
public class BannerAd : Details
55
{
66
private WXBannerAd _bannerAd;
7-
7+
88
private bool _isShow = false;
9-
9+
1010
private void Start()
1111
{
1212
// 绑定按钮事件
@@ -21,33 +21,42 @@ protected override void TestAPI(string[] args)
2121
// adUnitId 请填写自己的广告位 ID
2222
// 创建预设的 Banner 广告
2323
_bannerAd = WX.CreateFixedBottomMiddleBannerAd("adunit-xxxxxxxxxxxxxxxx", 30, 200);
24-
25-
_bannerAd.OnLoad((res) =>
26-
{
27-
WX.ShowModal(new ShowModalOption()
24+
25+
_bannerAd.OnLoad(
26+
(res) =>
2827
{
29-
content = "BannerAd OnLoad Result:" + JsonUtility.ToJson(res)
30-
});
31-
});
32-
_bannerAd.OnError((res) =>
33-
{
34-
WX.ShowModal(new ShowModalOption()
28+
WX.ShowModal(
29+
new ShowModalOption()
30+
{
31+
content = "BannerAd OnLoad Result:" + JsonUtility.ToJson(res)
32+
}
33+
);
34+
}
35+
);
36+
_bannerAd.OnError(
37+
(res) =>
3538
{
36-
content = "BannerAd onError Result:" + JsonUtility.ToJson(res)
37-
});
38-
});
39-
_bannerAd.OnResize((res) =>
40-
{
41-
WX.ShowModal(new ShowModalOption()
39+
WX.ShowModal(
40+
new ShowModalOption()
41+
{
42+
content = "BannerAd onError Result:" + JsonUtility.ToJson(res)
43+
}
44+
);
45+
}
46+
);
47+
_bannerAd.OnResize(
48+
(res) =>
4249
{
43-
content = "BannerAd onResize Result:" + JsonUtility.ToJson(res)
44-
});
45-
});
46-
47-
WX.ShowToast(new ShowToastOption()
48-
{
49-
title = "已创建广告"
50-
});
50+
WX.ShowModal(
51+
new ShowModalOption()
52+
{
53+
content = "BannerAd onResize Result:" + JsonUtility.ToJson(res)
54+
}
55+
);
56+
}
57+
);
58+
59+
WX.ShowToast(new ShowToastOption() { title = "已创建广告" });
5160
}
5261

5362
// 切换广告显示状态
@@ -57,30 +66,21 @@ private void SwitchAdState()
5766
{
5867
// 隐藏广告
5968
_bannerAd.Hide();
60-
WX.ShowToast(new ShowToastOption()
61-
{
62-
title = "已隐藏广告"
63-
});
69+
WX.ShowToast(new ShowToastOption() { title = "已隐藏广告" });
6470
}
6571
else
6672
{
6773
// 展示广告
6874
_bannerAd.Show();
69-
WX.ShowToast(new ShowToastOption()
70-
{
71-
title = "已展示广告"
72-
});
75+
WX.ShowToast(new ShowToastOption() { title = "已展示广告" });
7376
}
7477
}
7578

7679
// 销毁广告
7780
private void DestroyAd()
7881
{
7982
_bannerAd.Destroy();
80-
WX.ShowToast(new ShowToastOption()
81-
{
82-
title = "已销毁广告"
83-
});
83+
WX.ShowToast(new ShowToastOption() { title = "已销毁广告" });
8484
}
8585

8686
private void OnDestroy()

0 commit comments

Comments
 (0)