c# - VS Code 无法在 unity3D 中捕获断点
问题描述
一般来说,当我想调试时,我只需要设置断点,在 VSCode 中运行调试,然后在 Unity3D 中进入播放模式,如果它捕获任何断点,Unity3D 将暂停并导航到 VSCode 中的断点。但最近,我不能再这样做了。
这个问题出现在统一版本 2019 和 2020 中,我认为问题不在于我的编辑器,而在于我的 VSCode 和一些配置,但不知道如何解决。当我在 VSCode 中运行调试时,它仍然在调试控制台中附加了 Unity3D,在 google 上搜索了一些提示但没有解决问题。即使我创建了一个新项目,但它仍然无法正常工作。非常感谢任何提示。
这是我的 launch.json 文件
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Unity Editor",
"type": "unity",
"path": "/D:/WecoApp/WecoAppLocal/Library/EditorInstance.json",
"request": "launch"
},
{
"name": "Windows Player",
"type": "unity",
"request": "launch"
},
{
"name": "OSX Player",
"type": "unity",
"request": "launch"
},
{
"name": "Linux Player",
"type": "unity",
"request": "launch"
},
{
"name": "iOS Player",
"type": "unity",
"request": "launch"
},
{
"name": "Android Player",
"type": "unity",
"request": "launch"
},
{
"name": "Xbox One Player",
"type": "unity",
"request": "launch"
},
{
"name": "PS4 Player",
"type": "unity",
"request": "launch"
},
{
"name": "SwitchPlayer",
"type": "unity",
"request": "launch"
}
]
}
解决方案
这个答案与 Ubuntu 20.04 LTS 环境的相同问题有关。
配置完成后,您已经完成了 VSCode,(有关配置的更多详细信息,请参见如何在 Ubuntu 中使用 Visual Studio Code 开发 Unity3D 项目)您必须重新启动 PC。这一步没有提到。
推荐阅读
- macos - 运行私有 docker 映像时出错:standard_init_linux.go:207: exec 用户进程导致“exec 格式错误”
- reactjs - 带有按钮的 React Native FlatList 过滤器
- javascript - 将整数上的千数替换为 0
- python - 我可以改进这个 django 模型结构吗?
- c++ - 模板模板参数替换失败
- r - RShiny:在 Shiny 中创建 .docx 文件时出现问题
- python - 您如何将不规则张量与 tf.data 和 TFRecords 一起使用?
- performance - 如何在 Chrome 中测量渲染时间 1000 次?
- java - 从 RecyclerView 作为字符串接收的数组中的 ListView
- haskell - Haskell:按字典顺序对 3 个元组的第一个元素进行排序的函数