管理您的世界
测试与优化
调试
4min
ZEPETOScript 使用 Microsoft Visual Studio Code 和 JetBrains Rider 工具来帮助调试。
📘 编辑器
以下指南是使用 Visual Studio Code 准备的。
当 Visual Studio Code 安装完成后,打开 Unity 编辑器并转到 Unity 菜单 → 编辑 → 偏好设置下的外部工具选项卡。
![Document image Document image](https://images.archbee.com/fCt3n1oCa8rgNJ8fw9I2N-sTFpb4oznOHLlKmgaxG5Q-20240904-102421.png?format=webp)
在外部脚本编辑器中选择 Visual Studio Code。
![Document image Document image](https://images.archbee.com/fCt3n1oCa8rgNJ8fw9I2N-4VtJxLZWihwtkQ01tUE5x-20240904-102421.png?format=webp)
在 Visual Script 代码中,添加断点到您想要调试的 ZEPETO 脚本代码行。
![Document image Document image](https://images.archbee.com/fCt3n1oCa8rgNJ8fw9I2N-S9aoH7IaTZdv6raBQS2Zk-20240904-102421.png?format=webp)
播放 Unity 编辑器,并点击 Visual Script 代码中的 ② 开始调试按钮,位于 ① 运行与调试下。
![Document image Document image](https://images.archbee.com/fCt3n1oCa8rgNJ8fw9I2N-WJcbXa0gPQ4JGAHF7VmkI-20240904-102421.png?format=webp)
调试器在指定断点的代码行上激活。
![Document image Document image](https://images.archbee.com/fCt3n1oCa8rgNJ8fw9I2N-EX5NrEn1s9zwW80Fu2yyx-20240904-102421.png?format=webp)
在调试面板中,点击顶部选择的Zepeto脚本的调试环境选项卡。
将调试环境更改为Zepeto多人脚本。
![Document image Document image](https://images.archbee.com/fCt3n1oCa8rgNJ8fw9I2N-c1bRvAKYP3-bwKuKwC2KD-20240904-102421.png?format=webp)
点击开始调试按钮以开始调试。
![Document image Document image](https://images.archbee.com/fCt3n1oCa8rgNJ8fw9I2N-1saJP0gJDZWH0raknHY0w-20240904-102421.png?format=webp)
您可以通过查看调试控制台面板中显示的ZEPETO服务器日志来检查调试情况。
![Document image Document image](https://images.archbee.com/fCt3n1oCa8rgNJ8fw9I2N-kfeT5ZIHKyqk_JpjSU1EQ-20240904-102421.png?format=webp)