Build Settings

Build Settings

Unity User Manual 2021.3 (LTS)

在 Unity 中操作

编辑器功能

Build Settings

Shortcuts Manager

Incremental build pipeline

Build Settings

Unity can build your application for different platforms and with different settings. This documentation describes how to define the scenes, target platform, and settings for your build.

To select your platform and settings, and start the build process, use the Build Settings window. To access the Build Settings window: from Unity’s main menu, go to File > Build Settings.

Understanding builds

Unity produces two build types:

A release build, which includes only what’s necessary to run the application. This is the default build type.

A development build, which includes scripting debug symbols and the Profiler. Selecting the development build option enables an additional set of options, such as deep profiling support and script debugging. These options are explained in the Generic Platform Settings section.

For faster iteration during development, Unity uses an incremental build pipeline that rebuilds artifacts only if they have changed since the previous build. For more information, see Incremental build pipeline.

Managing scenes in a build

When you build your application, Unity builds all selected scenes in the Scenes In Build pane. Unity builds scenes in the order in which they appear in the list.

You can add, exclude, remove, and reorder scenes in the list:

To add all currently open scenes to the list: Select Add Open Scenes. You can also drag scenes from your Project window into the list.

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 the scene and press Delete.

To adjust the scene order: Drag and drop scenes in the list to reorder them.

Window, Mac and Linux build settings

Platform 列表

Each build must have a target platform. The Platform pane lists all the platforms you can build for.

Each version of Unity installed on your computer has its own platform list.

If the platform you need is not on the list, do one of the following:

In the Build Settings window:

Select the platform you want to add.

Select Install or Download.

In Unity Hub > Installs:

Select the three dots on the version of Unity you’re using.

Select Add Modules.

Follow the instructions to install the platform module.

To change the build’s target platform:

Select the platform you want to switch to.Tip: The list displays the Unity icon next to the platform currently selected as the target platform.

Select Switch Platforms.If Unity needs to re-import your assets in formats that match your target platform, the switch process can take a long time.

Build settings

When you select a platform, Unity displays a list of options that you can adjust for the build. Some settings apply to all platforms, and some are platform-specific.

Generic platform settings

以下设置适用于所有平台。

设置:

功能:

Development Build

Include scripting debug symbols and the Profiler in your build. You should use this setting when you want to test your application.When you select this option, Unity sets the DEVELOPMENT_BUILD scripting define. Your build then includes preprocessor directives that set DEVELOPMENT_BUILD as a condition (see Platform-dependent compilations).

Autoconnect Profiler

Automatically connect the Unity Profiler to your build.This option is only available if you selected Development Build.

Deep Profiling Support

Turn on Deep Profiling in the Profiler. This makes the Profiler instrument every function call in your application so it returns more detailed profiling data. This option might slow down script execution.This option is only available if you selected Development Build.

Script Debugging

Allow your script code to be debugged.This option is only available if you selected Development Build.This option is not available for WebGL.

Wait for Managed Debugger

Make the Player wait for a debugger to be attached before it executes any script code.This option is only available if you selected Script Debugging.

IL2CPP Code Generation

Define how Unity manages IL2CPP code generation.This option is only available if you are using IL2CPP for your scripting backend, not Mono.To change your scripting backend, go to Player Settings > Configuration > Scripting Backend and change from Mono to IL2CPP.

Faster runtime

Generates code that is optimized for runtime performance. This is the default, and the behavior in previous versions of Unity.

Faster (smaller) builds

Generates code that is optimized for build size and iteration. It generates less code and produces a smaller build, but may have an impact on runtime performance, especially for generic code. You might want to use this option when faster build times are important, such as when iterating on changes.

Compression Method

Compress the data in your Project when you build the Player. This includes Assets, Scenes, Player settings, and GI data.This option is not available for the Lumin and WebGL platforms.

Default

On PC, Mac, Linux Standalone, and iOS, there is no default compression.On Android, the default compression is ZIP, which gives slightly better compression results than LZ4HC. However, ZIP data is slower to decompress.

LZ4

A fast compression format that is useful for development builds. For more information, see BuildOptions.CompressWithLz4.

LZ4HC

A high compression variant of LZ4 that is slower to build but produces better results for release builds. For more information, see BuildOptions.CompressWithLz4HC.

Asset Import Overrides

To speed up import and platform switch time, you can locally override all texture import settings. Usually you would not ship your final build with any import overrides, but during development they can be useful to speed up iteration time, especially if you are not concerned with assets (textures, in this case) looking as good as possible.

To set asset import overrides for initial project imports, use the editor command line arguments -overrideMaxTextureSize and -overrideTextureCompression.

The default value for both override options is No Override.

设置:

功能:

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 number of pixels it contains, so a lower maximum allowed texture size can speed up import times. However, the resulting textures are lower resolution, so use this setting only during development.

Texture Compression

Override the texture compression options set in Texture import settings.Only affects textures imported into one of the compressed texture formats.

Force Fast Compressor

Use a faster but lower quality texture compression mode for formats that support it (BC7, BC6H, ASTC, ETC, ETC2). Usually this results in more compression artifacts, but for many formats the compression itself is 2 to 20 times faster.This setting also disables Crunch texture compression format on any textures that have it.The effect of this setting 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. This is faster to import (because it skips the texture compression process), but the resulting textures take up more memory and game data size, and can impact rendering performance.The effect of this setting is the same as if all textures had their Compression set to None in their platforms’ Texture import settings.

Platform-specific settings

Each platform also has specific build settings:

PC, Mac, and Linux Standalone: See PC, Mac, and Linux build settings.

Universal Windows Platform: See Universal Windows Platform build settings.

tvOS: See Building your application for tvOS.

iOS: See iOS build settings.

Lumin: See Partners - Magic Leap. Unity 2020 LTS is the final version of the editor that supports Magic Leap 1. To build for Magic Leap 1, use Unity 2020 LTS or 2019 LTS.

Android: See Android Build Settings.

WebGL: See Building and Running a WebGL project.

For the Build Settings for closed platform development, see the documentation included in the Unity installer, or consult the Unity Forums.

Building your application

To build your application, select one of the following:

Build: Compile a Player, then do nothing. The default build is incremental, except for the first build, which is always a full non-incremental (clean) build. To force a clean build instead of an incremental build, select Clean Build from the dropdown menu.

Build and run: Compile a Player and open it on your target platform (for more information, see the individual platform pages). This option always uses the incremental build.

Shortcuts Manager

Incremental build pipeline

相关推荐

大牛为何讨厌Java:深入探讨编程语言的偏好与痛点
mobile.365-588

大牛为何讨厌Java:深入探讨编程语言的偏好与痛点

11-07 👁️‍🗨️ 2574
2025热血合击传奇哪个版本最好玩?最新五大特色版本横向评测 | 传奇游戏发布网
薛平贵是哪个朝代的皇帝?他与薛仁贵有什么关系吗?
365bet体育滚球

薛平贵是哪个朝代的皇帝?他与薛仁贵有什么关系吗?

09-19 👁️‍🗨️ 3883
[题目]一瓶墨水重l00kg.( ) 题目和参考答案
365bet体育滚球

[题目]一瓶墨水重l00kg.( ) 题目和参考答案

09-20 👁️‍🗨️ 2369
太low了是什麼意思
365bet体育滚球

太low了是什麼意思

01-05 👁️‍🗨️ 6146
浅谈“圣水”
365bet信誉怎么样

浅谈“圣水”

08-26 👁️‍🗨️ 9134
16位女娲扮演者,张梓琳似美人鱼,盖鸣晖最有味道!
365bet信誉怎么样

16位女娲扮演者,张梓琳似美人鱼,盖鸣晖最有味道!

01-15 👁️‍🗨️ 585
鸣潮网络异常问题全解析:原因与解决方案
365bet信誉怎么样

鸣潮网络异常问题全解析:原因与解决方案

08-23 👁️‍🗨️ 619
如何轻松打开TTF字体文件?详细步骤与技巧全在这里!