unity教程一:配置vscode调试unity c# 环境

(一)下载vscode常用插件

Debugger for Unity
Unity Tools
Unity Code Snippets

Debugger for Unity环境配置


vscode-debug-view.png
vscode-debugger-list.png
vscode-debugger-unity.png
WX20210823-151512.png
WX20210823-151432.png
WX20210823-151440.png

(二)安装mono环境

https://www.mono-project.com/download/stable/
安装后输入mono查看是否能找到对应命令

(三)安装dotnet环境

https://dotnet.microsoft.com/download
安装后输入dotnet查看是否能找到对应命令
安装后记得关闭终端,vscode,unity,然后再打开不然会出现下面提示

出现报错 Unable to find Mono. Ensure that Mono's '/bin' folder is added to your environment's PATH variable
解决办法:
Got the same issue right now, perhaps occurred after recent MacOS update. Killed vscode, killed Unity. >Restarted Unity, regenerated project files (Unity -> Preferences -> External Tools) then opened vscode from >within Unity (dbclick on any script). Took about a minute for intellisense to kick off but it did eventually. Hope >it helps

(四)测试

完全重启vscode,unity
先后点击vscode调试,再点击unity上面的play,成功断点


WX20210823-151932.png

参考
https://code.visualstudio.com/docs/other/unity
https://github.com/OmniSharp/omnisharp-vscode/issues/4489
https://docs.unity3d.com/cn/current/Manual/ManagedCodeDebugging.html

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容