Debugging in Unity (C#) + Visual Studio Code Work on OS X?

后端 未结 7 1866
小鲜肉
小鲜肉 2021-02-12 10:04

I really like the idea of working with Visual Studio, C# and Unity on OS X.

Has anyone made debugging with C# in Unity work with Visual Studio Code on OS X?

相关标签:
7条回答
  • 2021-02-12 11:02

    [Feb 2017] It is now possible to do this without the dotBunny plugin.

    i.e. Support is built into Unity natively.

    Just to repeat, you don't need to fiddle with Unity, just VSCode.

    Instructions here

    Instructions are incomplete though, and I didn't take screenshots (please do!), but basically what I did was:

    (...and please improve these instructions as you go, I'm working from memory...)

    1. I deleted/renamed my .vscode/Launch.json file, as per the link.
    2. Double-click on some file to bring up the project in VSCode (maybe first make sure that in Unity's settings you have selected VSCode as your default code editor)
    3. clicking the bug icon then the cogwheel, as per the link.
    4. I had to install that vscode-unity-debug plugin in VSCode, just filtering the search with 'unity' found it.
    5. I then had to press the green 'play' triangle.
    6. I set a breakpoint in my code.
    7. Now over to unity and press play, and the breakpoint gets hit.
    0 讨论(0)
提交回复
热议问题