📜 ⬆️ ⬇️

About using Visual Studio Code in Unity under OS X

Hi, Habr!

As much as I would not like it, but intrigue in today's article will not. One could, of course, build verbose verbal constructions, play with synonyms, and delay the moment of truth, but no — this article is about using Visual Studio Code in Unity under OS X. VSCode to your project using the dotBunny plugin.

Use this as a quick start guide, guide or whatever it is called. In addition, if you have long wanted to try VSCode, but could not come up with a suitable script, then I composed everything for you - just follow the steps.
')


Carefully, under the cut a few screenshots.

In order to start developing on Unity under OS X, you need the following things (here you can begin to bend your fingers):
1) A computer running OS X. Any of the latest versions is potentially suitable.
2) Unity 5. Lives here - unity3d.com/ru/get-unity/download . In the installation there is nothing difficult, after downloading the installer, just agree with all the proposed points.
3) If you are completely new, then read a series of articles about creating a platformer - you can start reading from here

4) Next step - download Visual Studio Code - code.visualstudio.com . Code is a cross-platform editor, which appeared as a result of the following output: Visual Studio on OS X and Linux porting is long and expensive, but to have a high-quality lightweight editor that has all the editor features from Studio is very good and convenient. Soon the editor will become open-source (http://habrahabr.ru/company/microsoft/blog/271199/), and will have to be content with the installer. However, the installation of VSCode, as in the case of Unity, does not cause much trouble and passes quickly enough. As a result, you get a full-fledged C # editor, who is able to IntelliSence, code highlighting and other nice things, inherited from the “older sister” - the studio.



5) Next we need a plugin, without which nothing happens - github.com/dotBunny/VSCode . He is the one who allows you to make Code the default editor in Unity and correctly configure debugging mechanisms, IntelliSence and everything else. The debugger for Unity, by the way, works only in OS X so far, so you and I are very lucky. If you do not use git, you can use the quick link to download the archive with the plugin.

After loading the plugin, transfer the “Plugins \ Editor \ dotBunny” folder to the Assets folder of your project. If you don’t have the Plugins folder yet, create it. Right now.

On this, the fingers of the first hand are over, so put the other hand on the touchpad. Or use some kind of Jedi scrolling.

6) Find the VSCode tab in the Preferences window in Unity. In some cases (for example, if you are working in Unity under Windows), the search for this item in the menu may take some time - it is in the “Unity” menu.



All that is left to do to connect is to quickly hit the left kidney of the mouse on the “Enable Integration” checkbox. Like this:



Now the item “Open C # project in Code” has appeared in the Assets menu. This, as the name implies, allows you to open VSCode in the context of your project - and if you do not close the editor in the process, double-click scripts in Unity will also open the necessary script in the context of the project.

7) An open project looks like this:



In the left part of the window the structure of your project, all editable files. In the right part, in fact, the code editor, in which autocompletion, highlighting and all the other things that are dear to the heart from adult editors and development environments work. For more information on what and how in the Code you can read the link .

Fortunately, you can stop bending your fingers, because at this moment the Code is finally connected with Unity and we can work in the most comfortable and friendly environment. But, just in case, the last point.

8) Design a game. Make a smart project that will conquer the whole world and bring you endless glory. As you can see, the simplest point I left for sweet.

This is where the fairy tale ends. As usual, ask your questions in the comments and share your experience of using VSCode in the same place.

Useful links:

Source: https://habr.com/ru/post/271439/


All Articles