How to use Visual Studio Code as Unity3d script editor

vscode_256x256

Visual Studio Code has landed – a new code editor in the Visual Studio family that runs on both Windows, OSX and Linux.

My first thought when I saw Scott Hanselman show it on the BUILD 2015 keynote were how and if I could use this as the script editor for Unity3d C# scripts. MonoDev is just not my favorite editor.

The good news is that it is possible and simple!

On Windows

  1. Install Visual Studio Code :)
  2. Open Unity3d.
  3. Edit->Preferences->External Tools.
  4. In External Script Editor select Browse. Browse to C:\Users\USERNAME\AppData\Local\Code and select update.exe.
  5. In External Script Editor Args put in: –processStart Code.exe
  6. Close the window and you are set to go.

On OSX

  1. Install Visual Studio Code :)
  2. Unity->Preferences->External Tools
  3. In External Script Editor select Browse. Browse to and select Applications->Visual Studio Code.app.
  4. Close the window and you are set to go.

Applies to both Windows and OSX

The first time you double click on a C# script inside Unity3d, Visual Studio Code will not recognize the solution (.sln) file. Find the little “flame” in the bottom of Visual Studio Code, click it and select the .sln file for your project.

VisualStudioCodeProjectSelector

 

Actually this little “flame” is the real fixer for some Unity3d related problems, as with this solution VSCode will just open when ever you double click a C# script. So if you switch between more Unity3d projects, it’s not that ideal, as you need to go to File->Open Folder and select the folder with the .sln file in. Then you can select that .sln using this “flame” icon and you have IntelliSense and can start coding.

After you have done this, you have IntelliSense etc.

VSCodeIntellisenseUnity3d

I currently have not figured out the args that tells Visual Studio Code which file it should open. I know we in the Unity3d External Script Editor Args and put in “$(File)” with the file we double clicked. So it is just a matter of time before I figure out what the command in Visual Studio Code is. I have tried various combinations of –file, without any luck. If you know, let me know and I will this post.

Luckily, Visual Studio Code can do some awesome tricks, so you just hit CTRL+T (Windows) / CMD + T (OSX) and start to type the name of the script you would like to edit. Also remember to read about all the other features VSCode comes with.

Memrace v2.0 in the making

Memrace

First, what it Memrace?

Memrace is a small memory game, me and my brother, Mikkel, did in Unity3d back in the beginning of 2014.
It has in the time of writing, been “on-hold” for some months, as we have both been busy with other projects.

Our current version is v1.2 and is actually pretty fun to play. Sadly though, it is getting boring very quickly, as there is no real progress, and it becomes too hard too quickly. It’s a rough and basic version of the game we have in mind.

Therefore, we are now taking the time to start working on v2.0 of the game.

Here is a list of some of the things we have agreed on focusing on for the next version:

  • Focus exclusively on iOS for now.
    • This one sounds SO bad in my mind, but we can see on the stats we have, that our iOS users are the ones that are playing the most. We need to make things as simple as possible, as we are only two guys building this game at night in our free time – we both have a wife and kids! :)
  • Introduce some level system, to players can make process and we can control the difficulty of the game better.

So that’s it for now, just wanted to give a little “Developer Log” update, now that I got my new blog up and running.

Memrace is currently out on iOS, Windows Phone and Android.