After Unity VS Code Tool Demise, Microsoft Previews One Powered by C# Dev Kit
For game development, Microsoft is previewing a Unity extension to replace a neglected, hacked-up tool by the gaming company that withered on the vine.
The new Unity for Visual Studio Code extension in the code editor's marketplace is based on tech in the recently introduced C# Dev Kit, along with Microsoft's main C# extension. As such, its use requires an activated C# Dev Kit extension for VS Code and is subject to that tool's license terms, which are based on licensing for the Visual Studio IDE. That means, just like the Visual Studio Community version, enterprises can only use it for open source or educational purposes, though free individual use is permitted.
Introduced last week and being installed by nearly 11,000 developers at the time of this writing, the preview tool offers:
- A Unity debugger to debug Unity editor and Unity players.
- Unity specific C# analyzers and refactorings.
- Code coloration for Unity file formats (.asmdef, .shader, .uss, .uxml).
Microsoft published the preview after the original Unity tool for VS Code was last year deprecated by Unity Technologies. The gaming company in June 2022 said it was removing the tool from the list of packages enabled by default for new projects. "This plugin was a result of one of our hackweek experiments by a few of our former employees," Unity said. "Unfortunately, it's never been fully functional and hasn't received any updates for almost two years, bringing you an unstable coding experience."
The new replacement tool seems to have been readily accepted in the Unity community, judging from the response to a Unity Technologies' post from last Thursday that explains, "The extension supports code editing powered by Roslyn for better Intellisense and AI assisted coding, backed up by the Unity Roslyn Analyzers to give you code suggestions specific to Unity. It also helps with debugging, running in the Unity Editor or standalone players. Use the new 'Attach Unity Debugger' command in Visual Studio Code, and set a breakpoint to get into the VS Code debugging experience."
Along with the C# Dev Kit introduced in June (see the Visual Studio Magazine, article, "What's in Microsoft's New C# Dev Kit for Visual Studio Code"), the new Unity tool is also built on Microsoft's main open source C# extension (nearly 23 million installs). As Unity mentioned above, it also includes the Roslyn Analyzers project for custom suggestions and code fixes tailored to Unity.
"With this extension, Visual Studio Code becomes a great companion application to Unity where you can write and debug your Unity games," Microsoft said in last week's announcement. "C# Dev Kit and the Unity extension borrow some familiar features from Visual Studio and Visual Studio Tools for Unity to enhance your productivity, making your Unity development delightful with C# in Visual Studio Code, regardless of the platform you target; desktop, mobile, or consoles, and everything in between."
For those wanting to use a full-featured IDE rather than a code editor, Microsoft recommends the Visual Studio Tools for Unity package, which is is a Visual Studio workload procured from the IDE's installer.
David Ramel is an editor and writer for Converge360.