Unity 3D and Visual Studio Code for Mac is…

Awesome!! Today, Microsoft released a “code optimized” version of Visual Studio called Visual Studio Code that will run on Mac and Linux (and of course Windows). And it is BEAUTIFUL! I’ve been looking for an alternative to MonoDevelop with Unity 3D for some time, and VS Code feels like it might be the real deal.

Some early commenters on the Unity 3D forum were peeved that it’s not a full-blown IDE, or “it’ll only be good for Javascript and web dev”. Do not listen to the naysayers! Granted, it is a “Preview” version product, but so far, it is working with Unity 5 like a charm.

Setting up VSCode for Unity is Simple, but Read This!

It is simple to get it working, but you need to do a couple of things.  Some people on the Unity forums tried to simply download Code and open their c# files and the intellisense didn’t work, and they assumed that VS Code was a bust.  I admit, that’s exactly what I did, but I didn’t give up.  Here are the simple steps:

  1. Download and install Visual Studio Code from Microsoft
    1. It’s simple on the Mac…just drag the .app to Applications folder once you open the downloaded package
  2. Open your Unity project
  3. Go to Assets > Sync MonoDevelop Project (this will make sure your .sln file is all set)
  4. Open VS Code
  5. Do File > Open in VSCode and open your Unity project folder (top level of your project)
  6. Important – at the bottom of the VS Code window, there is a blue status bar.  You should see a little fire icon. It may be followed by # projects.  Click that icon and select your project’s csharp.sln file. When you click the icon, it will pop up a box at the top that lists the available solution files.  You want the one that is named “<your project name>-csharp.sln”.
    1. If the box at the top of the screen has an option that says “Change projects”, that means you’re already working in a project. In this case, you can:
      1. Click “Change projects”
      2. Then select your project’s csharp.sln file as above

Visual Studio Code on a 2013 MacBook Pro- 1st Day Impressions

  • Intellisense is working beautifully with my project’s code
    • You can even leave a word half finished go away with the cursor and come back and Intellisense will pick it up and start working where you left off.  I’ve been using VS 2010 at work lately and it doesn’t do that…very annoying
  • VSCode is fast and responsive
  • It looks great!
  • Haven’t tried the Git and probably won’t.  I’m using SourceTree for BitBucket with Unity and the integrated client in Xcode for normal dev
  • It feels like a native Mac app, but some of the Keyboard shortcuts aren’t Mac…maybe there’s a way to fix that
    • For instance, Cmd-Delete is supposed to delete everything to the left of the cursor back to beginning of the line of text you’re on, but it doesn’t appear to be doing anything
    • Shift+Cmd+k deletes the whole line
    • Control-Delete, weirdly, duplicates the text on the line…huh.
    • Control-Clicking on a file in the file tree opens the code in side-by-side view with the existing file in the editor…neat
    • I tried editing the Keyboard shortcuts, but adding my edits to the override file didn’t work, even after restarting the app.  You can tell it’s early days since that process is you editing a json file.

All-in-all, I’m very happy to have Microsoft supporting Mac with this.  They also announced a code transformer that will let you take your iOS objective-c code and port it to Windows phone with minimal tweaks.  That’s going to be interesting too. Microsoft is really doing some very interesting things.  Good on ya!

Cheers,

Byron

Comments are closed.

Powered by WordPress. Designed by Woo Themes