nomadro/apps/minigame/使用前阅读.md
Eric 58a845db32 Add WeChat minigame triple-engine scaffold with Godot Chiang Mai plaza SoT.
Unity and Cocos stay as parallel schemes; apps/minigame ships the Godot 4.7 WeChat pack for DevTools.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-06 20:17:14 +08:00

25 lines
1.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 4.5版本重新优化文件系统, 现在原始各种形式的文件访问都能够正确实现
# 音频方向改动, 4.5中音频处理默认处理方式外, 对于背景音这种长时间后台播放的音频建议[Playback Type]使用sample的播放形式, sample将会使用wx原生inneraudio进行播放, 避免游戏帧率不稳定/低时的音频断断续续的表现
# 网络请求httpclient完成适配
# 分包加载说明:
- 本模板已经按 Godot 分包插件的新格式接入:主包在 `engine/empty-tips.bin`,分包在 `subpackages/<分包名>/`。
- 游戏内不要再手写 `JavaScriptBridge + ProjectSettings.load_resource_pack`;统一使用 `SubpackRuntime.ensure_subpack_with_dependencies("<分包名>")`。
- `game.json` 里每个 Godot 分包都要有一个同名微信分包,例如 `name: "subpack", root: "subpackages/subpack/"`。
- 微信要求每个分包根目录有 `game.js`,空文件即可;导出整理脚本会自动生成。
# 分包pck加载文件系统优化注意:
- 默认加载pck会保持在内存, 当你有多个pck额外加载的时候注意内存控制及时释放, 下面是是否pck在内存中的占用, 释放不影响功能代码逻辑,只是没有在内存的文件会经历一个加载过程, 自行进行合理分割安排
```gdscript 从内存卸载pck
var sdk = JavaScriptBridge.get_interface("GODOTSDK")
var result = sdk.releasePck(current_pck)
if result:
print("pck卸载成功")
```
# 微信开发者工具版本的选择及设置
- 我是用的是 RC 2.01.2510241, 差不多是最新版
- wasm特效启用设置, 设置->通用设置->打开浏览器实验性设置->Experimental WebAssembly(Enabled), 然后重启编辑器即可
# GLX 兼容性开关
- 默认使用 WeChat GLX。遇到设备黑屏时,将 `glx-config.js` 中的 `GameGlobal.__GODOT_DISABLE_WXGLX` 设为 `true`,启动将固定使用标准 `webgl2`;不要在运行后切换。