Skip to content

Commit 69a4e86

Browse files
author
uhu
committed
docs: update
1 parent 14d41b5 commit 69a4e86

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed

Design/AndroidProfile.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
- 2.1 通过webgl导出目录下的symbols文件对照映射
3636
- 2.2 通过[替换脚本](https://github.com/wechat-miniprogram/minigame-unity-webgl-transform/blob/main/tools/update_v8_wasm_profile.py)对cpuprofile进行自动映射到真实函数。使用方式:python update_v8_wasm_profile.py $cpuprofile $symbol
3737
3. 如希望能从游戏启动立即抓取profile,请在game.js末尾代码稍作修改:
38-
```
38+
```js
3939
const gl = GameGlobal.canvas.getContext('webgl')
4040
gl.clear(gl.COLOR_BUFFER_BIT);
4141
setTimeout(() => {

Design/BackendServiceStartup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ exports.main = async (event, context) => {
7171

7272
修改 config.json,增加对 openapi.security.msgSecCheck 的声明,如没有用到 openapi 则无需修改 config.json:
7373

74-
```
74+
```json
7575
"permissions": {
7676
"openapi": [
7777
"security.msgSecCheck"

Design/FirstSceneOptimization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
## CallMain Profile分析
4343
1.改造小游戏代码
4444
因为安卓采集Profile文件需要手动控制,而CallMain会在码包下载编译完成和首包资源下载完成后就执行,为了录制启动阶段完整的Profile,需要保证Profile的录制开始之后才真正执行游戏开始逻辑,找到项目的game.js文件,改造最后几行即可:
45-
```
45+
```js
4646
// gameManager.startGame();
4747

4848
wx.onTouchStart((result) => {

Design/HowToDebug.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
1. 已验证Unity版本:2018.3/2018.4LTS、2019.2/2019.4LTS
3030
安装时选择WebGL组件
3131
2. 如果你用的是Big Sur版本的Mac系统,并且Unity 版本小于 2019.4.14, 则需另外安装 [python3](https://www.python.org/downloads/),并安装brotli 命令如下
32-
```
32+
```sh
3333
python3 -m pip install brotli
3434
```
3535

Design/InputAdaptation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
详细示例请参考[API Demo](https://github.com/wechat-miniprogram/minigame-unity-webgl-transform/tree/main/Demo/API)
1010

1111
以UGUI的Input组件为例,需要给Input 绑定以下脚本:
12-
```
12+
```csharp
1313
using UnityEngine;
1414
using System.Collections;
1515
using WeChatWASM;

Design/WX_SDK.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ API可以直接看`WX.cs`这个文件,里面有`详细注释说明`。
1010

1111
本Unity的SDK的API大体与[官网](https://developers.weixin.qq.com/minigame/dev/guide/)的JS版本API类似,使用时可以参考之。
1212
如JS版的banner广告的调用如下:
13-
```
13+
```js
1414
var bannerAd = wx.createBannerAd({
1515
adUnitId: "xxxx",
1616
adIntervals: 30,
@@ -29,7 +29,7 @@ API可以直接看`WX.cs`这个文件,里面有`详细注释说明`。
2929
});
3030
```
3131
而对于Unity版的调用如下:
32-
```
32+
```csharp
3333

3434
var bannerAd = WX.CreateBannerAd(new WXCreateBannerAdParam()
3535
{
@@ -64,7 +64,7 @@ API可以直接看`WX.cs`这个文件,里面有`详细注释说明`。
6464
1. 只保留game.js前面import部分,其余删除,即不运行游戏逻辑。
6565
2. 增加以下代码:
6666

67-
```
67+
```js
6868
const gl = GameGlobal.canvas.getContext('webgl')
6969
gl.clear(gl.COLOR_BUFFER_BIT);
7070
```

Design/fixScreen.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var info = WX.GetWindowInfo();
1111
float py = (float)info.safeArea.top / (float)info.windowHeight;
1212
// Rootrect初始时设置其Anchor,使其与父节点一样大,也就是屏幕的大小
1313
// 调整屏幕移到刘海屏下面,
14-
Rootrect.anchorMin = new Vector2((float)info.safeArea.left / (float)info.windowWidth, -(float)info.safeArea.top / (float)info.windowHeight );
14+
Rootrect.anchorMin = new Vector2((float)info.safeArea.left / (float)info.windowWidth, -(float)info.safeArea.top / (float)info.windowHeight);
1515
// 重新计算缩放,让高度占满刘海屏以下的区域
1616
cs.referenceResolution = new Vector2(cs.referenceResolution.x, cs.referenceResolution.y * (1.0f+py));
1717
```

Design/video.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 视频设计
1+
# 视频设计规范
22

33
*建议启动视频内带有团队宣传logo动画,游戏logo动画,带有吸引力的游戏玩法视频*
44
---

0 commit comments

Comments
 (0)