Skip to content

Commit 8d89173

Browse files
authored
Merge pull request #958 from NoahZuo/main
doc: 修正CallMain Profile说明
2 parents bba6204 + 628dc2c commit 8d89173

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Design/FirstSceneOptimization.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,21 @@
4141

4242
## CallMain Profile分析
4343
1.改造小游戏代码
44-
因为安卓采集Profile文件需要手动控制,而CallMain会在码包下载编译完成和首包资源下载完成后就执行,为了录制启动阶段完整的Profile,需要保证Profile的录制开始之后才真正执行游戏开始逻辑,找到项目的game.js文件,改造最后几行即可:
44+
因为安卓采集Profile文件需要手动控制,而CallMain会在码包下载编译完成和首包资源下载完成后就执行,为了录制启动阶段完整的Profile,需要保证Profile的录制开始之后才真正执行游戏开始逻辑,找到项目的game.js文件,做如下改造:
45+
46+
- 搜索`loadingPageConfig`字段,添加`visible: false`字段,如下:
47+
48+
```js
49+
hideAfterCallmain: true,
50+
loadingPageConfig: {
51+
visible: false,
52+
// 以下是默认值
53+
totalLaunchTime: 7000,
54+
animationDuration: 100,
55+
```
56+
57+
- 搜索`gameManager.startGame()`字段,将其放入wx.onTouchStart事件中,如下:
58+
4559
```js
4660
// gameManager.startGame();
4761

0 commit comments

Comments
 (0)