集成开发环境 (IDE) 是一种计算机软件,提供工具和配套功能来方便开发其他软件。Unity 支持以下 IDE:
在 Windows 和 macOS 上安装 Unity 时,默认情况下会安装 Visual Studio。在 Windows 上,可以在选择要下载和安装的组件时选择将其排除。Visual Studio 在 Preferences 设置中设置为 __External Script Editor__(菜单:__Unity > Preferences > External Tools > External Script Editor__)。启用此选项后,Unity 将启动 Visual Studio 并将其用作所有脚本文件的默认编辑器。
在 macOS 上,Unity 使用 Visual Studio for Mac 作为 C# 集成开发环境。Visual Studio Tools for Unity (VSTU) 为 Visual Studio for Mac (VS4M) 提供 Unity 集成。有关设置和使用 Visual Studio for Mac 的信息,请参阅以下 Microsoft 文档页面:
在 Windows 上,Unity 还包括 Visual Studio 2017 Community。
Unity 支持在 Visual Studio Code (VS Code) 中打开脚本。要在 VS Code 中打开脚本,请在 Editor Preferences 设置中将其选为 __External Script Editor__(菜单:__Unity > Preferences > External Tools > External Script Editor__)。有关将 VS Code 与 Unity 结合使用的信息,请参阅关于使用 VS Code 进行 Unity 开发 (Unity Development with VS Code) 的 Visual Studio 文档。
为了使用 Visual Studio Code 进行 C# 代码编辑并获得 Unity C# 调试支持,需要安装:
Unity 支持在 JetBrains Rider 中打开脚本。要在 Rider 中打开脚本,请在 Editor Preferences 设置中将其选为 __External Script Editor__(菜单:__Unity > Preferences > External Tools > External Script Editor__)。
Rider 构建于 ReSharper 之上,并包含其大部分功能。此程序支持 C# 7.2 的所有功能以及 Unity 中的 .NET 4.6 脚本运行时上的 C# 调试。有关更多信息,请参阅有关 Rider for Unity 的 JetBrains 文档。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.