Unity安装

版本

  • 按照地域,分为两个版本:国际通用版(国际版)、中国增强版(中国版)(版本号后面有“c1”字样);
    • 中国增强版是真的增强:多出的本地化功能见下图:
    • 国际版和中国版使用的Unity Hub是不一样的:
    • 对应的Unity编辑器可以使用上述Unity Hub进行安装,也可以下载离线包:
    • 同时,国际版还提供Unity Download Assistant:
    • 始终推荐使用Unity Hub进行安装:Unity Hub安装时会自动安装Unity需要的附加组件(Android SDK、OpenJDK、Visual Studio等),而使用离线包安装时则需要自己安装上述附加组件;
  • 按照生命周期,分为两个版本:普通版和长期支持版(LTS);
    • 游戏是一个大型项目,因此只推荐使用LTS版本;普通版本可以作为影视项目、静图渲染、技术可行性验证或其他小项目;
    • 在选定版本后,整个游戏的制作和更新周期内一般不会再更换,因此一定要确保所选择的客户端版本的稳定性;

安装位置

以Unity版本2021.3.24f1为例:

  • 使用Unity Hub安装时,默认安装目录为:C:\Program Files\Unity\Hub\Editor\2021.3.24f1\Editor
  • 使用Unity Download Assistant或者离线安装包手动安装时,默认安装目录为:C:\Program Files\Unity 2021.3.24f1

Visual Studio

若当前电脑上没有Visual Studio,且只为使用Unity而使用Visual Studio:

  • 推荐安装最新版本Visual Studio(当前为VS2022),不用安装旧版本Visual Studio(例如Unity 2021推荐的Visual Studio 2019);
  • 可以通过命令行手动安装,以Visual Studio 2022为例;
    • 下载Visual Studio Community在线安装程序:https://aka.ms/vs/17/release/vs_community.exe
    • 使用如下命令行添加Unity所需的组件。注:Visual Studio版本不同会导致部分组件不存在,因此建议使用Unity Hub自动安装;Visual Studio实际安装的组件要比列出的多,因为会自动补全组件依赖项;以下命令为便于阅读拆分为多行,执行时需合并为一行;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
.\vs_community.exe --add Microsoft.VisualStudio.Component.CoreEditor ^
--add Microsoft.VisualStudio.Workload.CoreEditor ^
--add Microsoft.VisualStudio.Component.NuGet ^
--add Microsoft.VisualStudio.Component.Roslyn.Compiler ^
--add Microsoft.VisualStudio.Component.Roslyn.LanguageServices ^
--add Microsoft.Component.MSBuild ^
--add Microsoft.VisualStudio.Component.TextTemplating ^
--add Microsoft.Net.Component.4.7.1.TargetingPack ^
--add Microsoft.VisualStudio.Component.VC.CoreIde ^
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 ^
--add Microsoft.VisualStudio.Component.VC.Redist.14.Latest ^
--add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core ^
--add Microsoft.VisualStudio.Component.Windows10SDK.19041 ^
--add Microsoft.VisualStudio.Workload.NativeDesktop ^
--add Microsoft.Net.ComponentGroup.4.8.DeveloperTools ^
--add Microsoft.VisualStudio.Component.Unity ^
--add Microsoft.VisualStudio.Workload.ManagedGame ^
--lang zh-CN
  • 也可以创建Visual Studio本地安装源:假设下载至D:\VSInstall,则命令行参数加入:
1
--layout D:\VSInstall

离线文档

Unity Hub的日志

  • 若Unity Hub无法打开,或安装Unity出错,或出现其他错误,均可以
评论