To create a build for Linux, go to File > Build Settings from Unity’s main menu. In the Platform list, select Linux and then click Switch Platform.
When you have configured the Build Settings, choose from the following two options:
The Scenes In Build pane displays a list of the Scenes from your Project that Unity includes in the build. If you cannot see any Scenes in this pane, select Add Open Scenes to add all the currently open Scenes to the build. You can also drag Scene Assets from your Project window into this window.
To exclude a Scene in the list from the build, clear the checkbox next to that scene. This removes the Scene from the build, but not from the list. To remove a Scene from the list, select it and press the Delete key on your keyboard.
When you select Build or Build and Run, Unity creates a build that includes all Scenes in the Scenes in Build list. Unity uses the list of Scenes to determine the order that it loads the Scenes in. To adjust the order of the Scenes, drag them up or down the list.
Platform 面板会列出 Unity Editor 中所有可用的平台。该列表会在当前被选为目标平台的平台名称旁显示 Unity 图标。
Unity 会根据您已安装的平台模块来确定可用的平台。
要将其他平台模块安装到项目中,请执行以下操作:
To change the target platform, select the platform you want to switch to, then select Switch Platforms. This might take some time, because Unity might need to re-import your Assets in formats that match your target platform.
When you select a platform, Unity displays a list of options that you can adjust for the build. Each platform has unique settings which are listed on each <platform-specific (anchor)> manual page. Select the Windows, Mac, Linux build target to build standalone applications for most desktop platforms. For specific build settings, see Windows, Mac, Linux build settings.
以下设置适用于所有平台。
设置 | 功能 | |
---|---|---|
Development Build | 启用此设置可以在构建版本中包含脚本调试符号和性能分析器 (Profiler)。启用此设置后,Unity 会设置 DEVELOPMENT_BUILD 脚本 define 指令。需要测试应用程序时,应使用此设置。 |
|
Autoconnect Profiler | 启用此设置可以将 Unity 性能分析器 (Unity Profiler) 自动连接到您的构建版本。仅在启用 Development Build 后,此设置才可用。 | |
Deep Profiling Support | Enable this setting to turn on Deep Profiling in the Profiler. This makes the Profiler instrument every function call in your application and returns more detailed profiling data. When you enable Deep Profiling Support, it might slow down script execution. This option is only available if you enable Development Build. | |
Script debugging | Enable this setting to allow your script code to be debugged. Not available on WebGL. This option is only available if you enable Development Build. |
|
Wait for Managed Debugger | Enable this setting to be prompted to attach a debugger before it executes any script code. This option is only available if you enable Development Build. |
|
Compression Method(在 Lumin 或 WebGL 平台上不可用) | 在构建播放器时压缩项目中的数据。这些数据包括资源 (Assets)、场景 (Scenes)、播放器 (Player) 设置和 GI 数据。选择以下方法之一: | |
Default | On Windows, Mac, Linux, and iOS, there is no compression by default. On Android, the default compression is ZIP, which provides better compression results than LZ4HC; however, data is slower to decompress. | |
LZ4 | 一种快速压缩格式,对开发构建很有用。有关更多信息,请参阅 BuildOptions.CompressWithLz4。 | |
LZ4HC | LZ4 的高度压缩变体,构建速度更慢,但对于发行版构建可以产生更好的结果。有关更多信息,请参阅 BuildOptions.CompressWithLz4HC。 |
The Asset Import Overrides section allows you to locally override all texture import settings to speed up import and platform switch time. You must avoid shipping your final build with any import overrides; however, during development they can be useful to speed up iteration time, especially, if assets such as textures resulting in lower resolution is not of any concern.
设置 | 功能 | |
---|---|---|
Max Texture Size | Override the maximum imported texture size. Unity imports textures in the lower of two values: this value, or the Max Size value specified in Texture import settings. The time it takes to import a texture is roughly proportional to the amount of pixels it contains, therefore, reducing maximum allowed texture size can speed up the import times. However, as this setting might result in lower resolution textures, use it only for development. |
|
Texture Compression | Override the texture compression options set in Texture import settings. This only affects textures imported into one of the compressed texture formats. |
|
Force Fast Compressor | Use a faster yet lower quality texture compression mode for formats where this is applicable (BC7, BC6H, ASTC, ETC, ETC2). Typically, this results in more compression artifacts, but for many formats the compression itself is many times faster (2 to 20 times faster). This setting also disables the Crunch texture compression format on any textures that have it. The effect is the same as if all textures had their Compressor Quality set to Fast setting in their platform’s Texture import settings. |
|
Force Uncompressed | Do not compress the textures; use uncompressed formats instead. Note that while this is faster to import because it skips the whole texture compression process, the resulting textures take up more memory, game data size, and can impact rendering performance. Texture import settings. This option has the same effect as all textures that have their Compression set to None in their platforms’ Texture Import settings. |
You can also set Asset import override settings using -overrideMaxTextureSize
and -overrideTextureCompression
Editor Command line arguments to change any initial project import.
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.