Dec
26
2015

Useful Settings for Visual Studio 2015 + Unity

Finally installed VisualStudio with unity, 2015 community edition (update 1) seems pretty good so far (new monodevelop was too bugged..)
Here’s some common settings to go look for when customizing the vs editor.

SOURCE CODE MINIMAP

Quick launch command: scroll bars (select text editor > c# scroll bars)
vs_source_scrollbar_minimap_2015
vs_source_scrollbar_minimap

LINE NUMBERS

Quick launch command: line numbers (select Text editor > all languages > general)

vs2015_line_numbers_enable

CUSTOM SHORTCUT KEYS

Feature: F1 for Unity API help search
Quick launch command: shortcut (select environment > keyboard)

vs_unity_api_help_shortcut

Feature: § key for “Go to Declaration” (the key before “1”, its  ` key in most keyboards).
Quick launch command: shortcut (select environment > keyboard)
Note: Cannot assign § as Global shortcut, so need to select “Use new shortcut in: Text Editor”
vs_unity_go_to_declaration_shortcut

Feature: Shift+§ key for “Find All References”
Quick launch command: shortcut (select environment > keyboard)

vs_unity_find_all_references_shortcut

Feature: F12 shortcut key for “Format Document”
Quick launch command: shortcut (select environment > keyboard)
vs_unity_format_document_shortcut

SOURCE CODE FORMATTING

Feature: Keep “} else {” braces in same line
Quick launch command: formatting (select text editor > c# > formatting)
Deselect those 3 options below:

vs_unity_source_format_else_braces_shortcut

Adding support for Unity shader syntax highlighting

Download NShader for 2015 here: http://www.horsedrawngames.com/shader-syntax-highlighting-in-visual-studio-2013/

Installing NShader: Unzip “NShader_2015.zip” double click the “NShader.vsix” and its done
vs2015_unity_shader_highlight

Those default colors are quite horrible, but can adjust them at Fonts and Colors settings
nshader_syntax_highlight_colors_unity_vs2015

Tip: Removing unused extensions

Quick launch command: extensions (select tools > Extensions & updates..)

Then uninstall anything that you don’t need (i only left NuGet and that Unity package)
vs_2015_remove_extra_tools

Fixing “Inconsistent Line Endings” warning

Quick launch command: documents (select Environment > documents)
vs2015_check_for_inconsistent_line_endings_1

Or convert line endings for the current document
Quick launch command: save (select File > advanced save options..)

vs2015_fix_check_for_inconsistent_line_endings_2

 

Other things:
– There is no UnityScript support anymore, learn c# 🙂
– I unistalled all the SQL server related packages, silverlight, helpviewer etc. from add-remove programs in windows, they come with VS minimum install..
– Unity installer doesn’t allow installing VS to other drives, its forced to C: drive, which is annoying.. tried to uninstall VS, re-install by manually downloading VS + unity plugin, but it didnt allow changing the target folder, its grayed out.. still have to look for some solution to that, there is no proper full uninstaller for VS2015 community update 1 either..


What i’m still missing:

– API help should open to separate browser, not inside VS and not IE
– Duplicate line shortcut (i think in mono CTRL+D used to work), although currently you still can do CTRL+C, then CTRL+V (without anything selected it duplicates the current line)
– Would be nice to have that “Refactor/using system.io..” in right click menu, instead of the slow dropdown.. (when you write File.Exists(), right clicking File would allow adding the using System.IO..)
– Pressing F5 in VS would compile scripts, and hit play in unity..

Separate VS Downloads *These are also included in unity installer if you select [x] Visual studio there
– Visual Studio Community (free) : https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx
– VS Tools for Unity (free) : https://www.visualstudio.com/en-us/features/unitytools-vs.aspx


20 Comments + Add Comment

Leave a comment

Connect

Twitter View LinkedIn profile Youtube Github Join Discord Twitch Instagram BlueSky

UnityLauncherPro

Get UnityLauncherPRO and work faster with Unity Projects!
*free unity hub alternative

@unitycoder_com

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.