Skip to content

Commit bad0933

Browse files
authored
Merge branch 'main' into doc/qa_render
2 parents 2ca569c + 8ef71e2 commit bad0933

File tree

11 files changed

+144
-28
lines changed

11 files changed

+144
-28
lines changed

.config/.vitepress/config.mts

+1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ export default defineConfig({
147147
items: [
148148
{ text: "开发错误调试与排查", link: "/Design/DebugAndException" },
149149
{ text: "现网错误日志上报与排查", link: "/Design/IssueForProduction" },
150+
{ text: "MiniGameConfig.asset 说明", link: "/Design/AssetDescription" },
150151
],
151152
},
152153
{

Demo/API_V2/Assets/API/OpenInterface/GameClub/GameClub.cs

+15-15
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ IEnumerator CreateGameClubButton(float delay)
4343
});
4444
}
4545

46-
// ²âÊÔ API
46+
// 测试API
4747
protected override void TestAPI(string[] args)
4848
{
4949
getGameClubData();
@@ -82,22 +82,22 @@ private void getGameClubData()
8282

8383
private bool _isGameClubShow = false;
8484

85-
// Çл»ÓÎϷȦ°´Å¥ÏÔʾ/Òþ²Ø
85+
// 切换游戏圈按钮显示/隐藏
8686
private void GameClubButtonSwitch()
8787
{
88-
//if (_isGameClubShow)
89-
//{
90-
// // ÏÔʾÓÎϷȦ°´Å¥
91-
// _gameClubButton.Show();
92-
// GameManager.Instance.detailsController.ChangeExtraButtonText(0, "Òþ²ØÓÎϷȦ°´Å¥");
93-
//}
94-
//else
95-
//{
96-
// // Òþ²ØÓÎϷȦ°´Å¥
97-
// _gameClubButton.Hide();
98-
// GameManager.Instance.detailsController.ChangeExtraButtonText(0, "ÏÔʾÓÎϷȦ°´Å¥");
99-
//}
100-
//_isGameClubShow = !_isGameClubShow;
88+
// if (_isGameClubShow)
89+
// {
90+
// // 显示游戏圈按钮
91+
// _gameClubButton.Show();
92+
// GameManager.Instance.detailsController.ChangeExtraButtonText(0, "隐藏游戏圈按钮");
93+
// }
94+
// else
95+
// {
96+
// // 隐藏游戏圈按钮
97+
// _gameClubButton.Hide();
98+
// GameManager.Instance.detailsController.ChangeExtraButtonText(0, "显示游戏圈按钮");
99+
// }
100+
// _isGameClubShow = !_isGameClubShow;
101101
}
102102

103103
private void GameClubButtonDestroy()

Demo/API_V2/Assets/API/OpenInterface/SystemButton/SystemButton.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ IEnumerator CreateFeedbackButton(float delay)
4747
yield return new WaitForSeconds(delay);
4848

4949
Vector2 size = GameManager.Instance.detailsController.GetInitialButtonSize();
50-
Vector2 position = GameManager.Instance.detailsController.GetButtonPosition(1);
50+
Vector2 position = GameManager.Instance.detailsController.GetButtonPosition(0);
5151
var systemInfo = WX.GetSystemInfoSync();
5252
_feedbackButton = WX.CreateFeedbackButton(new CreateOpenSettingButtonOption()
5353
{

Demo/API_V2/Assets/WX-WASM-SDK-V2/Editor/MiniGameConfig.asset

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ MonoBehaviour:
1414
m_EditorClassIdentifier:
1515
ProjectConf:
1616
projectName: GameClubDemo
17-
Appid: wxf616b60467bcfcaf
17+
Appid: wxb7d4485dbc1233ca
1818
CDN:
1919
assetLoadType: 1
2020
compressDataPackage: 0
2121
VideoUrl:
22-
DST: C:/Users/xiaoyuejin/Desktop/gametest
22+
DST: C:/Users/xiaoyuejin/Desktop/finaltest
2323
StreamCDN:
2424
bundleHashLength: 32
2525
bundlePathIdentifier: StreamingAssets;

Design/AssetDescription.md

+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# MiniGameConfig.asset 配置文件说明
2+
3+
位于 `Assets/WX-WASM-SDK-V2/Editor/MiniGameConfig.asset` 即为 WXSDK 的导出配置文件,其中部分配置可在微信小游戏导出面板中可视化配置,本节将对配置文件中各项字段进行说明,开发者可直接修改其配置内容。
4+
5+
## Project Config
6+
7+
| 字段 | 类型 | 说明 |
8+
| --- | --- | --- |
9+
| projectName | string | 项目名称。 |
10+
| Appid | string | 微信小游戏Appid,前往 https://mp.weixin.qq.com/ 注册获得。 |
11+
| CDN | string | 游戏CDN前缀。 |
12+
| assetLoadType | int | 首资源包加载方式,0: CDN加载;1: 小游戏包内加载。 |
13+
| compressDataPackage | bool | 将首包资源Brotli压缩, 降低资源大小. 注意: 首次启动耗时可能会增加200ms, 仅推荐使用小游戏分包加载时节省包体大小使用。 |
14+
| VideoUrl | string | 加载阶段视频URL,可缺省。 |
15+
| DST | string | 导出路径。 |
16+
| StreamCDN | string | 已废弃。 |
17+
| bundleHashLength | int | 自定义Bundle文件名中hash部分长度,默认值32,用于缓存控制。 |
18+
| bundlePathIdentifier | string | 路径中包含特定标识符开始下载bundle,将被自动缓存。半角分号分隔。 |
19+
| bundleExcludeExtensions | string | 排除路径下指定类型文件不缓存。半角分号分隔。 |
20+
| AssetsUrl | string | 已废弃。 |
21+
| MemorySize: 256 | int | 游戏内存大小(MB)。 |
22+
| HideAfterCallMain | bool | callmain完成后是否立即隐藏加载封面。 |
23+
| preloadFiles | string | 预下载列表。半角分号分隔。 |
24+
| Orientation | int | 设备方向,0:Portrait; 1:Landscape; 2:LandscapeLeft; 3:LandscapeRight|
25+
| bgImageSrc | string | 启动背景图。 |
26+
| dataFileSubPrefix | string | 拼接在DATA_CDN和首包资源文件名的路径,用于首包资源没放到DATA_CDN根目录的情况。 |
27+
| maxStorage | int | 最大缓存容量,单位MB,设置后若接近容量阈值将自动回收。 |
28+
| defaultReleaseSize | int | 清理缓存时默认额外清理的大小,单位Bytes,默认值30MB。 |
29+
| texturesHashLength | int | 微信压缩纹理工具处理的尾部hash长度,用于识别缓存。 |
30+
| texturesPath | string | 微信压缩纹理工具处理的纹理CDN拼接路径。 |
31+
| needCacheTextures | bool | 是否缓存微信压缩纹理工具处理的贴图资源。 |
32+
| loadingBarWidth | int | 加载进度条的宽度,默认240。 |
33+
| needCheckUpdate | bool | 是否需要启动时自动检查小游戏是否有新版本。 |
34+
| disableHighPerformanceFallback | bool | 是否禁止开启高性能模式后在不支持的iOS设备上回退为普通模式,注意:不要随意修改,只有开通高性能模式后并确认不回退才修改。 |
35+
| IOSDevicePixelRatio | float | IOS限制固定的分辨率,以减少内存,但是会降低游戏画面品质。 |
36+
37+
## SDKOptions:
38+
39+
| 字段 | 类型 | 说明 |
40+
| --- | --- | --- |
41+
| UseFriendRelation | bool | 是否使用好友关系链。 |
42+
| UseCompressedTexture | bool | 已废弃。 |
43+
| UseMiniGameChat | bool | 是否使用社交组件。 |
44+
| PreloadWXFont | bool | 是否使用预载系统字体。 |
45+
46+
## CompileOptions:
47+
48+
| 字段 | 类型 | 说明 |
49+
| --- | --- | --- |
50+
| DevelopBuild | bool | Development Build. |
51+
| AutoProfile | bool | Autoconnect Profiler. |
52+
| ScriptOnly | bool | Scripts Only Build. |
53+
| Il2CppOptimizeSize | bool | 对应于Il2CppCodeGeneration选项,勾选时使用OptimizeSize(默认推荐),生成代码小15%左右,取消勾选则使用OptimizeSpeed。游戏中大量泛型集合的高频访问建议OptimizeSpeed,在使用HybridCLR等第三方组件时只能用OptimizeSpeed。(Dotnet Runtime模式下该选项无效)。 |
54+
| profilingFuncs | bool | Profiling Funcs. |
55+
| Webgl2 | bool | WebGL2.0 |
56+
| fbslim | bool | 导出时自动清理UnityEditor默认打包但游戏项目从未使用的资源,瘦身首包资源体积。(团结引擎已无需开启该能力)。 |
57+
| DeleteStreamingAssets | bool | Clear Streaming Assets. |
58+
| ProfilingMemory | bool | Profiling Memory. |
59+
| CleanBuild | bool | Clean WebGL Build. |
60+
| CustomNodePath | string | 已废弃。 |
61+
| showMonitorSuggestModal | bool | 是否显示最佳实践检测弹框。 |
62+
| enableProfileStats | bool | 是否显示性能面板。 |
63+
| enableRenderAnalysis | bool | 是否显示渲染分析日志(develop build才生效)。 |
64+
| iOSAutoGCInterval | int | iOS高性能模式自动GC间隔(毫秒)。 |
65+
| enableIOSPerformancePlus | bool | 是否使用iOS高性能Plus。 |
66+
| brotliMT: 1 | bool | 是否使用brotli多线程压缩 |
67+
68+
## CompressTexture:
69+
70+
以下是微信压缩纹理工具涉及配置,如未使用微信压缩纹理工具可以不予设置。
71+
72+
| 字段 | 类型 | 说明 |
73+
| --- | --- | --- |
74+
| halfSize | bool | 已废弃。|
75+
| useDXT5 | bool | 是否开启PC压缩纹理。 |
76+
| bundleSuffix | string | 已废弃。|
77+
| parallelWithBundle | int | 已废弃。 |
78+
| bundleDir | string | 自定义AB包目录路径。 |
79+
| dstMinDir | string | 压缩纹理产物输出目录。 |
80+
| debugMode | bool | 是否开启仅ASTC模式。 |
81+
| force | bool | 是否强制重新执行。 |
82+
83+
84+
## PlayerPrefsKeys:
85+
86+
使用PlayerPref接口时传入的key,此处设置将预先加载。
87+
88+
## FontOptions:
89+
90+
字体相关配置。
91+
92+
| 字段 | 类型 | 说明 |
93+
| --- | --- | --- |
94+
|CJK_Unified_Ideographs | bool | - |
95+
|C0_Controls_and_Basic_Latin | bool | - |
96+
|CJK_Symbols_and_Punctuation | bool | - |
97+
|General_Punctuation | bool | - |
98+
|Enclosed_CJK_Letters_and_Months | bool | - |
99+
|Vertical_Forms | bool | - |
100+
|CJK_Compatibility_Forms | bool | - |
101+
|Miscellaneous_Symbols | bool | - |
102+
|CJK_Compatibility | bool | - |
103+
|Halfwidth_and_Fullwidth_Forms | bool | - |
104+
|Dingbats | bool | - |
105+
|Letterlike_Symbols | bool | - |
106+
|Enclosed_Alphanumerics | bool | - |
107+
|Number_Forms | bool | - |
108+
|Currency_Symbols | bool | - |
109+
|Arrows | bool | - |
110+
|Geometric_Shapes | bool | - |
111+
|Mathematical_Operators | bool | - |
112+
|CustomUnicode | bool | - |

Design/CustomURP.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
- 下面是一个 [供参考的 URP 定制版本](#供参考的 URP 定制版本)
114114

115115
>>#### 供参考的 URP 定制版本
116-
- 开发者请联系助手 `minigamedevop08` 获取微信定制版的 URP 源码
116+
- 开发者请联系 [小游戏客服助手](https://work.weixin.qq.com/kfid/kfcca4feec277f91616) 获取微信定制版的 URP 源码
117117
- 这是基于 Unity 2021.3.19 的 URP 12.1.10 版本定制的渲染管线,主要是用来参考如何定制 URP 管线,
118118
- 这个 URP 版本是基于大部分微信小游戏的渲染需要来定制的,主要修改有以下这些:
119119
- 不影响 GPU Instancing 和 SRP Batcher

Design/DevelopmentQAList.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,12 @@ if (WXConvertCore.DoExport() == WXConvertCore.WXExportError.SUCCEED) {
146146
- 不行,不提供内嵌webview或跳转的能力
147147
#### 5.小游戏是否支持Unity VideoPlayer
148148

149-
- 不行,小游戏支持视频播放能力,但暂无法直接使用VideoPlayer。请参考[小游戏开发者文档](https://developers.weixin.qq.com/minigame/dev/api/media/video/wx.createVideo.html)以及示例[Video Demo](https://github.com/wechat-miniprogram/minigame-unity-webgl-transform/tree/main/Demo/WX_Video)
150-
#### 6.为什么使用Application.targetFrameRate无法限帧率?安卓左上角帧率不对
149+
- 支持,但是IOS有限制只能同时播放一个,并且需要注意基础库版本限制,低版本无法播放。如果只是单纯使用全屏的视频播放,更推荐使用小游戏API视频播放能力。请参考[小游戏开发者文档](https://developers.weixin.qq.com/minigame/dev/api/media/video/wx.createVideo.html)以及示例[Video Demo](https://github.com/wechat-miniprogram/minigame-unity-webgl-transform/tree/main/Demo/WX_Video)
150+
#### 6.小游戏应该使用哪个接口进行限制帧率?
151151

152-
- Application.targetFrameRate默认使用timer控制帧率,会导致不平滑,定时不精确
153-
- 请更换接口WX.SetPreferredFramesPerSecond限制小游戏
152+
- Application.targetFrameRate
153+
- 使用导出插件的“性能面板”(ProfileStats)可以看到帧耗时、限帧与当前FPS
154+
- 使用Perfdog查看帧率并不总是准确,因为30/15等帧率是微信使用raf分帧处理,Perfdog统计的是raf触发帧率而不是分帧后的帧率。
154155
#### 7.Unity Audio音频是否需要使用小游戏音频适配
155156

156157
- 转换方案已通过WebAudio支持Unity音频,通常无需替换

Design/IssueAndContact.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# 问题反馈与联系我们
2-
开发者使用转换方案时,如果遇到问题可以随时反馈给我们。目前可通过[Git Issue](https://github.com/wechat-miniprogram/minigame-unity-webgl-transform/issues)和“研发助手号”微信两种方式
2+
开发者使用转换方案时,如果遇到问题可以随时反馈给我们。目前可通过[Git Issue](https://github.com/wechat-miniprogram/minigame-unity-webgl-transform/issues)和“小游戏客服助手”微信客服两种方式
33

44

55
## Git Issue

Design/UnityProfiler.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# 使用Unity Profiler性能调优
2-
1. 导出选项时勾选"Development Build"与"Autoconnec Profiler"
2+
3+
1. 导出选项时勾选"Development Build"与"Autoconnect Profiler"
34

45
<img src='../image/profile1.png' width="800"/>
56

@@ -17,7 +18,8 @@
1718
4. 调整UnityProfiler IP/端口
1819

1920
网页WebGL/小游戏启动后将通过"ws://ip:port"自动连接到“Unity Profiler”, 此地址默认为编译机器的。如果无法连接请查看微信开发者工具Network页签对应的ws链接是否正常可达。
20-
如需手工调整IP、端口可通修改webgl.framework.js:
21+
如需手工调整IP、端口可通修改`webgl.wasm.framework.unityweb.js`
22+
2123
```
2224
if(port == 54998)
2325
{

Design/UnityVersion.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
## Unity InstantGame版本获取
3232

33-
中国特供版[下载地址](https://unity.cn/instantgame/docs/WechatMinigame/InstallUnity)
33+
中国特供版[下载地址](https://unity.cn/instantgame/docs/WechatMinigame/InstallUnityWithTuanjieBackport/)
3434

3535

3636
## QA

Design/iOSOptimization.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ iOS 端小游戏高性能模式适用于遇到 iOS 环境运行性能不足,
134134

135135
### <p id="6-ui-flicker"/>6. 个别游戏 UI 会出现闪烁问题
136136
- 目前已发现iOS 15.4出现若干渲染BUG,如stencil特性支持,请查阅文档[优化Unity WebGL的渲染性能](RenderOptimization.md)
137-
- 如按上述文档去除依然无法解决,请提供可复现 Unity 工程联系 minigamedevop08
137+
- 如按上述文档去除依然无法解决,请提供可复现 Unity 工程联系 [小游戏客服助手](https://work.weixin.qq.com/kfid/kfcca4feec277f91616)
138138

139139
### 7. 为什么开启了高性能模式,游戏启动很烫?
140140

0 commit comments

Comments
 (0)