Pre-requests
Install VSCode from one of the following ways
- Download
.deb
from official download link apt
- Ubuntu software (
snap
)
Install Unity Hub and Unity Editor
You can follow this link to install Unity Hub from apt
.
Then you can install Unity Editor inside Unity Hub, and create a new project.
Settings in Unity Editor
Open the new project. In the project’s top menu bar, select Edit -> Preferences...
In the window, find External Tool
option at the left side menu, and in the right-side External Script Editor
option, switch it to Visual Studio Code
.
Then, check all options under Generate .csproj files for:
title and click Regenerate project files
button.
Install dotnet-sdk and mono
In this section, try your best to make sure the version is exactly the same with me. I cannot promise other versions are fine, even though the version may vary little.
- Install
dotnet-sdk-6.0.400
from here. Note: you need to adddotnet
to$PATH
so that VSCode can find it. - Install
mono-6.12.0.182
from here. Note: at the time I post this, there’s noUbuntu 22.04
section in mono download page. I use the exactly same commands withUbuntu 20.04
section and it works.
You can check whether the version is correct by the following commands
dotnet --version
mono --version
Final settings in VSCode
You are almost there, just a few steps!
- In VSCode, install the
c#
extension. - In
c#
extension setting, uncheckUse Modern Net
option. - In
c#
extension setting, fill in theMono Path
with the output of commandwhich mono
. - Restart your PC.