unity教程一:配置vscode調(diào)試unity c# 環(huán)境

(一)下載vscode常用插件

Debugger for Unity
Unity Tools
Unity Code Snippets

Debugger for Unity環(huán)境配置


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

(二)安裝mono環(huán)境

https://www.mono-project.com/download/stable/
安裝后輸入mono查看是否能找到對(duì)應(yīng)命令

(三)安裝dotnet環(huán)境

https://dotnet.microsoft.com/download
安裝后輸入dotnet查看是否能找到對(duì)應(yīng)命令
安裝后記得關(guān)閉終端,vscode,unity,然后再打開不然會(huì)出現(xiàn)下面提示

出現(xiàn)報(bào)錯(cuò) 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

(四)測(cè)試

完全重啟vscode,unity
先后點(diǎn)擊vscode調(diào)試,再點(diǎn)擊unity上面的play,成功斷點(diǎn)


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

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容