Skip to content

Commit

Permalink
docs: update
Browse files Browse the repository at this point in the history
  • Loading branch information
uhu committed Sep 2, 2024
1 parent 14d41b5 commit 69a4e86
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Design/AndroidProfile.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
- 2.1 通过webgl导出目录下的symbols文件对照映射
- 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
3. 如希望能从游戏启动立即抓取profile,请在game.js末尾代码稍作修改:
```
```js
const gl = GameGlobal.canvas.getContext('webgl')
gl.clear(gl.COLOR_BUFFER_BIT);
setTimeout(() => {
Expand Down
2 changes: 1 addition & 1 deletion Design/BackendServiceStartup.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ exports.main = async (event, context) => {

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

```
```json
"permissions": {
"openapi": [
"security.msgSecCheck"
Expand Down
2 changes: 1 addition & 1 deletion Design/FirstSceneOptimization.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
## CallMain Profile分析
1.改造小游戏代码
因为安卓采集Profile文件需要手动控制,而CallMain会在码包下载编译完成和首包资源下载完成后就执行,为了录制启动阶段完整的Profile,需要保证Profile的录制开始之后才真正执行游戏开始逻辑,找到项目的game.js文件,改造最后几行即可:
```
```js
// gameManager.startGame();

wx.onTouchStart((result) => {
Expand Down
2 changes: 1 addition & 1 deletion Design/HowToDebug.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
1. 已验证Unity版本:2018.3/2018.4LTS、2019.2/2019.4LTS
安装时选择WebGL组件
2. 如果你用的是Big Sur版本的Mac系统,并且Unity 版本小于 2019.4.14, 则需另外安装 [python3](https://www.python.org/downloads/),并安装brotli 命令如下
```
```sh
python3 -m pip install brotli
```

Expand Down
2 changes: 1 addition & 1 deletion Design/InputAdaptation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
详细示例请参考[API Demo](https://github.com/wechat-miniprogram/minigame-unity-webgl-transform/tree/main/Demo/API)

以UGUI的Input组件为例,需要给Input 绑定以下脚本:
```
```csharp
using UnityEngine;
using System.Collections;
using WeChatWASM;
Expand Down
6 changes: 3 additions & 3 deletions Design/WX_SDK.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ API可以直接看`WX.cs`这个文件,里面有`详细注释说明`。

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

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

```
```js
const gl = GameGlobal.canvas.getContext('webgl')
gl.clear(gl.COLOR_BUFFER_BIT);
```
Expand Down
2 changes: 1 addition & 1 deletion Design/fixScreen.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var info = WX.GetWindowInfo();
float py = (float)info.safeArea.top / (float)info.windowHeight;
// Rootrect初始时设置其Anchor,使其与父节点一样大,也就是屏幕的大小
// 调整屏幕移到刘海屏下面,
Rootrect.anchorMin = new Vector2((float)info.safeArea.left / (float)info.windowWidth, -(float)info.safeArea.top / (float)info.windowHeight );
Rootrect.anchorMin = new Vector2((float)info.safeArea.left / (float)info.windowWidth, -(float)info.safeArea.top / (float)info.windowHeight);
// 重新计算缩放,让高度占满刘海屏以下的区域
cs.referenceResolution = new Vector2(cs.referenceResolution.x, cs.referenceResolution.y * (1.0f+py));
```
Expand Down
2 changes: 1 addition & 1 deletion Design/video.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 视频设计
# 视频设计规范

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

0 comments on commit 69a4e86

Please sign in to comment.