Skip to content

Commit 147864a

Browse files
author
Ocean
committed
2 parents 245385b + ff214e3 commit 147864a

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Diff for: Demo/API_V2/Assets/Scripts/GameManager.cs

+4-5
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,12 @@ private void Awake()
7171
);
7272

7373
// 获取微信小游戏的系统信息
74-
#if UNITY_WEBGL && !UNITY_EDITOR
7574
WindowInfo = WX.GetWindowInfo();
7675
MenuButtonBoundingClientRect = WX.GetMenuButtonBoundingClientRect();
77-
#else
78-
WindowInfo = new WindowInfo { safeArea = new SafeArea() };
79-
MenuButtonBoundingClientRect = new ClientRect();
80-
#endif
76+
77+
// 非小游戏与预览环境下防止报错
78+
WindowInfo ??= new WindowInfo { safeArea = new SafeArea() };
79+
MenuButtonBoundingClientRect ??= new ClientRect();
8180
}
8281
);
8382
}

Diff for: Design/WXFont.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# 微信系统字体
22
游戏基本会使用中文,中文字体大小少则2-3M。
33

4-
通过微信系统字体,从本地加载中文,可节省启动下载的资源量。再不支持使用微信系统字体时,回退成通过CDN下载后备字体的形式。
4+
通过微信系统字体,从本地加载中文,可节省启动下载的资源量。在不支持使用微信系统字体时,回退成通过CDN下载后备字体的形式。
5+
6+
**IOS18暂不支持使用微信系统字体,必须提供后备字体才能正常使用。**
57

68
## 版本要求
79
`转换插件 >= 202306292010` 提供了 `WX.GetWXFont` 接口用于加载后备/系统字体

0 commit comments

Comments
 (0)