本手册将以微信小游戏平台为例,指导您如何有效使用 Frame Debugger,以提升开发效率和调试体验。
在 Build Settings 窗口中切换到 MiniGame 平台,配置并勾选小游戏构建配置文件 Inspector 中的 Development Build 选项,来支持 Frame Debugger 功能。
在 Player Settings 中,选择 Resolution and Presentation,确保勾选 Run In Background 选项,以便在调试时更加方便。
我们为小游戏平台提供了一个新的 build 参数 Frame Debugger Build,可以打包出带有 Frame Debugger 功能的 release 版本,相比 development build 更轻量。
需要在对应小游戏构建配置文件 Inspector 中选择 Frame Debugger Build。注意当选中 Development Build 时,该参数不生效。
Frame Debugger Build 打包出来的包,需要配合外置 boot.config 一同使用才能连接到 editor ,详见下文中的 外置boot.config
该模式下打包生成后,同样会得到两个文件夹。其中 minigame 文件夹下的项目不支持外置 boot.config ,因此无法在该类情况下使用 Frame Debugger 。在 WebGL 文件夹下的项目可以使用 Frame Debugger 。
其他与 Development Build 下使用 Frame Debugger 相同。
正常build到对应路径,例如路径 /Build/
在 /Build/ 下创建一个 boot.config,或者找到生成的 boot.config,其为项目路径下 $ProjectName/Library/PlayerDataCache/WeixinMiniGame/Data ,并将其复制到 /Build/ 目录文件夹
运行 WebGL,其会自动读取目录 boot.config 。修改后,刷新网页即可使用。
player-connection-mode=Connect
player-connection-guid=2969982123
player-connection-debug=0
player-connection-project-name=My project
player-connection-wait-timeout=-1
player-connection-ip=aaa.bbb.ccc.ddd
player-connection-ip=eee.fff.ggg.hhh
profiler-enable=1
wait-for-native-debugger=0
hdr-display-enabled=0
该参数的关键在于 player-connection-ip,需将其设置为 Editor 所在机器的 IP 地址。也可以指定端口号,但如果不熟悉端口配置,建议保持默认设置。