The Missing Editor for Unity Development: Visual Studio Code

Recently, I am working for my own game project, using Unity. I used Unity for almost 5 years. Unity is great, it make game developing a lot more easy and enjoyable. But there is a problem that annoyed me so long: I can't find a great editor for coding (in C# script). The default IDE of Unity, MonoDevelop, is awkward for use: it take long time to launch and has a terrible user interface. I have also tried Sublime Text and Vim, but both of them have some issue. Then, Microsoft brought Visual Studio Code. I used it since the day it was introduced and I must say, it is like "giving a glass of ice water to somebody in hell" for Unity developer, especially if you are using Mac.

Microsoft made Visual Studio Code a cross-platform editor. Whether you are using Windows, OS X, Linux, no problem, you can use it in your own computer. Also, it is free, just download, unzip and start coding.

Unlike MonoDevelop, Visual Studio Code is a lightweight IDE. It launch instantly, scrolling and navigating fluidly, have low CPU and memory usage. It have clear, modern, highly-polished user interface, support Full Screen mode in OS X, just like Sublime Text.

Getting Visual Studio Code integrating with Unity is fairly simple: get the plugin, put it into your Unity project, enable it in the Preference window, done, see the official guide. After integration, Visual Studio Code works well with Unity. Double click the error and waring hints in Unity, it will jump into the right place in the Visual Studio Code editor window.

Visual Studio Code have plenty features works perfectly such as code colorization, bracket matching, IntelliSense, split view and so on. I love features called "Code Lens" and "Peek": you can see the number of references to an method directly above the method, and you can click it to show where the method is used:

Visual Studio Code - Code Lens and Peek

I use C# script as programming language in my own Unity project and the syntax highlighting works well with C# script. I also wrote some custom shaders for fascinating 2D visual effects. Since version 0.8, Visual Studio Code support code highlighting of ShaderLab:

Syntax Highlighting of ShaderLab

If you are using Visual Studio Code on Mac, you can debug right in the Visual Studio Code. Of course, it's great!

Since these great features, Visual Studio Code is definitely the missing editor for Unity development. Good works, Microsoft!