如何使用 Visual Studio Code 在 Ubuntu 中开发 Unity3D 项目 [英] How do I use Visual Studio Code to develop Unity3D projects in Ubuntu

查看:62
本文介绍了如何使用 Visual Studio Code 在 Ubuntu 中开发 Unity3D 项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 KDE neon(基于 Ubuntu 18.04).我已经安装了 Unity3D 的最新 Linux 版本

<小时>

2. 安装 Visual Studio Code 的Debugger for Unity"扩展

3. 安装最新版本的Mono"

Mono 是 Microsoft 赞助的 Microsoft .NET Framework 的开源实现.存储库安装说明:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EFecho "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" |须藤三通/etc/apt/sources.list.d/mono-official-stable.listsudo apt 更新sudo apt install mono-devel

6. 在 Visual Studio Code 中设置Unity Debugger"

选择左侧的调试视图并单击齿轮.

在下拉列表中选择Unity Debugger".如果列表中没有 Unity Debugger,那么您的项目中已经有一个 .vscode/Launch.json 文件,您必须先将其删除.

现在您的 Unity 项目文件夹中将有一个 .vscode/Launch.json 文件,您可以选择要调试的 Unity 目标.

(来源).

I have KDE neon (based on Ubuntu 18.04). I have installed the latest Linux version of Unity3D from this link.

I need a C# script editor to start developing C# projects. How do I setup Visual Studio Code to work with Unity3D projects? I need it to auto-complete code and underline compilation errors.

解决方案

Please note that the following instructions contain commands that are specific for 18.04. Please check the sources if you have a different version of Ubuntu or Linux.


1. Install the C# extension for Visual Studio Code


2. Install the "Debugger for Unity" extension for Visual Studio Code

3. Install the latest version of "Mono"

Mono is an open source implementation of Microsoft's .NET Framework sponsored by Microsoft. Instructions for a repository installation:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update
sudo apt install mono-devel

(Source). It also has instructions for 16.04 and 14.04.

4. Install dotnet

wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-2.1

(Source). It also has instructions for 16.04, 14.04 and others.

5. Open your project's folder with Visual Studio Code

6. Set the "Unity Debugger" in Visual Studio Code

Select the debug view on the left and click the cogwheel.

In the drop down list select "Unity Debugger". If you do not have Unity Debugger in the list, then you already have a .vscode/Launch.json file in your project that you must delete first.

You will now have a .vscode/Launch.json file in your Unity project folder and can select which Unity target you wish to debug.

(Source).

这篇关于如何使用 Visual Studio Code 在 Ubuntu 中开发 Unity3D 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆