VS Code Unity Debugger Extension Preview

Discussion in 'Scripting' started by lukaszunity, Nov 24, 2015 at 11:41 AM.

  1. lukaszunity

    lukaszunity

    Unity Technologies

    Joined:
    Jun 11, 2014
    Messages:
    144
    Last week Visual Studio Code 0.10 (VS Code) was released and it now supports third-party extensions.

    Today, we are releasing a preview of a Unity debugger extension for VS Code, allowing you to debug your Unity C# projects in VS Code.

    vscode-4-attached.png
    Release Notes

    Version 0.1.0:
    • Only attaching to Unity editor is supported.
    Download
    Install instructions
    • Install Visual Studio Code 0.10 or newer and run it once.
    • Download the unity-debug zip-file above and extract it to a "unity-debug" folder. (package.json should be in the root of extracted the "unity-debug" folder)
    • OSX & Linux:
      • Install latest Mono framework.
      • Copy "unity-debug" folder into ${HOME}/.vscode/extensions/ (Create the “extensions” folder if it does not exist). OSX: You can open the .vscode folder using the Terminal app and typing “open ${HOME}/.vscode”
    • Windows:
      • Copy "unity-debug" folder into %USERPROFILE%\.vscode\extensions (Create the extensions folder if it does not exist)
    • (Re)start VS Code.
    • Open the root folder of your Unity project in VS Code.
    • Select the debug view on the left and click the cogwheel.
    vscode-1-debugview.png
    • In the drop down list select “Unity Debugger”.
      • If you do not have Unity Debugger in the list, that means you did not copy the unity-debug into the right folder in the steps above or you already have a .vscode/Launch.json file in your project that you must delete first.
    vscode-2-debugger-list.png
    • You will now have a .vscode/Launch.json file in your Unity project folder.
    vscode-3-launch-json.png
    • All done. You can now debug your C# scripts in VS Code by setting a breakpoint in a C# script from your project, switching to the debug view and clicking the green triangle button to attach to Unity. Enter play mode in Unity and the breakpoint should hit in VS code.
    Source code
     
    Last edited: Nov 24, 2015 at 12:38 PM
    Flipbookee, danw_unity and karl.jones like this.
  2. dousi96

    dousi96

    Joined:
    Jul 28, 2014
    Messages:
    14
    Thanks! Very usefull!!