Screenshot of a computer, game controller, and icons for game play.

Overview

Visual Studio Tools for Unity includes a rich set of features that enhances writing and debugging Unity C# scripts and working with Unity projects.

  • Troubleshoot, inspect, and explore code using a debugger that's tuned for Unity projects.
  • Discover and write Unity scripts quickly with Unity-specific IntelliSense code-completion.
  • Learn more about the code your writing by quickly accessing Unity documentation.
  • Write improve code with refactoring options that follow best practices for Unity scripts.
  • Identify how the Unity engine is calling your code with CodeLens hints for message functions and asset usages.
  • Much, much more than.

Available for Windows and macOS

Visit the Visual Studio Tools for Unity getting started with Tools For Unity. for more information nigh installation and setup.

Supported Unity versions

Visual Studio Editor Unity package

Unity 2020.1 and newer require a Unity Parcel for external editor tools like Visual Studio and Visual Studio for Mac. Documentation to Acquire more than about these changes in the Unity blog post..

The getting started section includes more information on the configuration of the Visual Studio Editor package.

The latest version of the Visual Studio Editor bundle is recommended.

Visual Studio Minimum Unity version Minimum package version
2022 Unity 2019.4 Visual Studio Editor ii.0.xi
2019 Unity 2017.4 Visual Studio Editor 2.0.0
2017 Not recommended N/A
Visual Studio for Mac Minimum Unity version Minimum bundle version
2022 Unity 2019.4 Visual Studio Editor 2.0.11
2019 Unity 2017.4 Visual Studio Editor 2.0.0
2017 Not recommended North/A

Features

Unity Issue Functions

Quickly and accurately add together Unity Event Functions, like Get-go, Update, and OnCollisionEnter to C# scripts with a few keystrokes using auto-complete suggestions powered past IntelliSense.

Screenshot of the IntelliSense dialog showing OnCollisionEnter.

Generate code for multiple Unity Upshot Functions and their comments using ⌘+Shift+M.

Quickly fix any parameter mistakes in Event Functions that were added manually with quick-fix suggestions.

High-operation debugger

Visual Studio Tools for Unity supports the robust debugging features that you expect from Visual Studio:

  • Set breakpoints, including conditional breakpoints.
  • Evaluate circuitous expressions in the Sentry window.
  • Inspect and modify the value of variables and arguments.
  • Drill down into complex objects and data structures.

Screenshot of Visual Studio stopped on a breakpoint inspecting variables.

Quick fixes and refactoring suggestions

Write better lawmaking that captures the best practices with Visual Studio'south deep agreement of Unity projects.

Screenshot of the Visual Studio refactoring string comparison with CompareTag.

CodeLens hints

Place where code is called from using CodeLens hints that evidence implicit calls from Unity assets. Select the hint to see a listing of implicit calls. Selecting a specific phone call will navigate directly to the object in the Unity Editor.

Speedily distinguish your code from Unity methods with hints for every Unity Event Function.

Screenshot of a new script showing CodeLens hints for Unity Script and Unity Message.

Unity Projection Explorer

Display project files in a way that matches the Hierarchy Window in the Unity Editor.

Screenshot of the Unity Project Explorer.

Unity project view

Visual Studio for Mac automatically displays project files in a way that match the Bureaucracy Window in the Unity Editor.

Unity documentation

View Unity documentation straight in tooltips when inspecting code.

Screenshot of Unity documentation showing in tooltips.

Quickly search Unity documentation past highlighting a grade or method name, then selecting the Assist > Unity API Reference menu item.

Support for shaders

Syntax highlighting and auto-complete for shader files.

Support for assembly definition files

Edit Unity Assembley Definition (.asmdef) files directly in Visual Studio with keyword coloring and completions.

Run and debug unit of measurement tests

Write, run, and debug unit tests direct in Visual Studio for Mac.

Automatically refresh Unity assets

Spend less fourth dimension switching back and forth between Unity and Visual Studio. Changes to code are automatically updated in Unity when files are saved.