我如何使用Visual Studio Code在Ubuntu中开发Unity3D项目

米娜·迈克尔(Mina Michael):

我有KDE neon(基于Ubuntu 18.04)。我已经从此链接安装了最新的Linux版本的Unity3D

我需要一个C#脚本编辑器才能开始开发C#项目。如何设置Visual Studio Code与Unity3D项目一起使用?我需要它来自动完成代码并强调编译错误。

米娜·迈克尔(Mina Michael):

请注意,以下说明包含特定于18.04的命令。如果您使用的是其他版本的Ubuntu或Linux,请检查来源。


1.安装Visual Studio Code的C#扩展

C#扩展截图


2.安装Visual Studio Code的“ Unity调试器”扩展

Unity扩展调试器截图

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

屏幕截图,使用Visual Studio Code打开项目文件夹

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

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

屏幕快照1来自Github

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.

屏幕快照2来自Github

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

屏幕快照3,来自Github

(来源)

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Visual Studio Code无法在Unity3D安装Ubuntu上找到.Net Framework

如何让我的新构造函数工作?我在 Visual Studio Code 中使用 Javascript

如何在Visual Studio 2015中更新我的C ++项目以使用新的Universal CRT?

如何使用 python 代码在 Visual Studio 2019 中打开我的项目

如何在Unity3d中将Visual Studio Code设置为默认脚本编辑器?

如何在Visual Studio Code中为我的Electron应用程序使用$ {workspaceRoot}?

Visual Studio无法连接到Unity3D iPhone

如何使Visual Studio Code使用Visual Studio IDE按键绑定?

使用C ++进行VSPackage开发,启动Visual Studio时如何初始化我的包

如果我使用 Visual Studio Code,我在 Visual Studio 中错过了什么?

如何在 Visual Studio 中使用 OpenCV Nuget 包发布我的 C# 项目?

如何找出我在 Visual Studio 2017 中使用的 c# 项目类型?

如何在 ubuntu 上运行我在 Windows for Linux 上使用 Visual Studio 编译的文件

我如何通过Visual Studio Code编译C ++文件

我们如何在 Visual Studio 中使用 SQL 编码时使用结果表中的数据?

如何在Visual Studio 2013中记录我的SQL调用?

IntelliTrace如何在我的Visual Studio Professional安装中可用?

我如何在Visual Studio 2010中打开btm文件

如何使用PowerShell在Visual Studio中获得项目版本?

如何使用向导在Visual Studio 2017中添加项目模板

如何更新使用Ubuntu Make安装的Visual Studio Code?

如何在 Visual Studio Code (Ubuntu) 中使用 NodaTime

我无法在Cygwin中使用Visual Studio中的cpp文件

将Unity3D项目从2019.2.12f1升级到2020.3.1f1后,Visual Studio Project中充斥着CS518错误

如何在Visual Studio Code中显示功能的使用?

如何使用任务在Visual Studio Code中运行Cmake

如何使用Visual Studio Code调试JavaScript中的摩卡测试?

我正在使用 C# Visual Studio 表单。如何将 Program.cs 中的 var 转换为 VS 表单?

如何使用MSI在Visual Studio中进行开发?