title | marp | paginate | math |
---|---|---|---|
VS Code setup |
true |
true |
mathjax |
- VS Code (or just VSC) is a popular open source text editor / IDE (integrated development environment) by Microsoft
- Very extensible by extensions
- Has many language-specific features like Omnisharp for C#
- Visual Studio is an older, bulkier IDE, also by Microsoft
- it has more features!
- Visual Studio Code is quite new, relatively lightweight
- originally scarce in features
- more popular in web development
- Both are used for Unity development
- We'll be using VS Code on this course
- Note: VS Code Unity Debug Extension has been recently deprecated
- We don't need the extension on this course, but it's good to know
- You can log in with your GitHub account to VS Code in the Accounts tab
- Then, by turning on Settings sync, your user-defined settings are carried over to whichever computer you're working on
- Include the Visual Studio Editor Package in your projects
- If you removed it, you can add it in Window > Package Manager
- Historical note: Yes, it says Visual Studio Editor, without the "Code". Previously, the Visual Studio Code Editor package was used; as of 2023, it is considered a legacy package.
- Set VS Code as your Unity default editor
- Edit > Preferences > External Tools > External Script Editor
- You might have to click the Regenerate project files button to get all features working
- Install the prerequisities for code completion & other niceness
- You need to install these applications:
- .NET Core SDK
- Remember to reboot your computer after installing
- .NET Framework 4.7.1 Developer Pack
- Be sure to download the Developer pack, not Runtime!!
- Note: In Windows, it's not shown as "developer pack" but as "targeting pack"
- Be sure to download the Developer pack, not Runtime!!
- .NET Core SDK
- You need to install these applications:
- Also, install these VS Code extensions:
- Open the project folder in VS Code
- Either by opening the folder from File Explorer context menu (Open with Code)
- Or in VS Code File > Open Folder...
- Omnisharp is a set of tools that makes programming C# easier
- After the previous procedure, VS code should have Omnisharp enabled
- error:
Could not locate ms build instance to register with Omnisharp
-
download Build tools for Visual Studio 2022 here
-
- Sometimes Omnisharp stops working. Here's something you can try to fix it:
- Check that .NET is installed by running
dotnet
in the VS code terminal - In Unity: Edit > Preferences > External tools > Regenerate Project Files
- In Unity:
Open VS Code with Assets > Open C# Project
- In VS Code: CTRL+SHIFT+P > Omnisharp: Restart Omnisharp
- In VS Code: Add this line inside the curly braces to the configuration file
.vscode/settings.json
:"omnisharp.useModernNet": false
- Marp for VS Code
- GitLens & Git Graph (See Git basics)