This page details the Player settings specific to Windows. For a description of the general Player settings, see Player Settings.
您可以在以下部分找到这些属性的文档:
Enable the Override for Windows, Mac, Linux setting to assign a custom icon for your desktop game. You can upload different sizes of the icon to fit each of the squares provided.
使用 Resolution and Presentation 部分可在 Resolution 和 Standalone Player Options 部分中自定义屏幕的外观方面。
此部分可以自定义屏幕模式和默认大小。
属性 | 描述 | |
---|---|---|
Fullscreen Mode | 选择全屏模式。此设置定义了启动时的默认窗口模式。 | |
Fullscreen Window | Set your app window to the full-screen native display resolution, covering the whole screen. This mode is also known as borderless full-screen. Unity renders the app content at the resolution set by a script, or the native display resolution if none is set and scales it to fill the window. When scaling, Unity adds black bars to the rendered output to match the display aspect ratio to prevent content stretching. This process is called letterboxing. The OS overlay UI displays on top of the full-screen window (such as IME input windows). All platforms support this mode. | |
Exclusive Fullscreen (Windows only) | Set your app to maintain sole full-screen use of a display. Unlike Fullscreen Window, this mode changes the OS resolution of the display to match the app’s chosen resolution. This option is only supported on Windows. | |
Maximized Window (Mac only) | Set the app window to the operating system’s definition of maximized, which is typically a full-screen window with a hidden menu bar and dock on macOS. This option is only supported on macOS. Fullscreen Window is the default setting for other platforms. | |
Windowed | Set your app to a standard, non-full-screen movable window, the size of which is dependent on the app resolution. In this mode, the window is resizable by default. Use the Resizable Window setting to disable this. All desktop platforms support this full-screen mode. | |
Default Is Native Resolution | Enable this option to make the game use the default resolution used on the target machine. This option isn’t available if the Fullscreen Mode is set to Windowed. | |
Default Screen Width | Set the default width of the game screen in pixels. This option is only available if the Fullscreen Mode is set to Windowed. | |
Default Screen Height | Set the default height of the game screen in pixels. This option is only available if the Fullscreen Mode is set to Windowed. | |
Mac Retina Support | Enable this option to enable support for high DPI (Retina) screens on a Mac. Unity enables this by default. This enhances Projects on a Retina display, but it’s somewhat resource-intensive when active. | |
Run In background | Enable this option to have the game running in the background instead of pausing if the app loses focus. |
This section allows you to specify how the user can customize the screen. For example, you can determine whether the user can resize the screen and how many instances can run concurrently.
属性 | 功能 |
---|---|
Capture Single Screen | Enable this option to ensure standalone games in Fullscreen Mode do not darken the secondary monitor in multi-monitor setups. |
Use Player Log | Enable this option to write a log file with debugging information. Defaults to enabled. |
Resizable Window | Enable this option to allow resizing of the desktop player window. Note: If you disable this option, your application can’t use the Windowed Fullscreen Mode. |
Visible in Background | Enable this option to display the application in the background if Windowed Fullscreen Mode is used. Note: This will prevent keyboard shortcuts that minimize the app window, for example, Alt+Tab and Windows+M, from functioning. For more information, refer to PlayerSettings.visibleInBackground. |
Allow Fullscreen Switch | 启用此选项可允许通过默认操作系统全屏按键在全屏模式和窗口模式之间切换。 |
Force Single Instance | Enable this option to restrict desktop players to a single concurrent running instance. |
Use DXGI flip model swap chain for D3D11 | Using the flip model ensures the best performance. This setting affects the D3D11 graphics API. Disable this option to fall back to the Windows 7-style BitBlt model. For more information, see PlayerSettings.useFlipModelSwapchain. |
Use the Virtual Reality Splash Image setting to select a custom splash image for Virtual Reality displays. For information on common Splash Screen settings, see Splash Screen.
此部分可以自定义一系列选项,这些选项分为以下几组:
Use these settings to customize how Unity renders your game for desktop platforms.
属性 | 功能 | ||
---|---|---|---|
Color Space | Choose which color space to use for rendering: Gamma or Linear. Refer to the Linear rendering overview for an explanation of the difference between the two. |
||
Auto Graphics API for Windows | 启用此选项可在运行游戏的 Windows 计算机上使用最佳图形 API。禁用此选项可添加和删除支持的图形 API。 | ||
Auto Graphics API for Mac | Enable this option to use the best Graphics API on the Mac the game is running on. Disable it to add and remove supported Graphics APIs. Windows doesn’t support this property. | ||
Auto Graphics API for Linux | 启用此选项可在运行游戏的 Linux 计算机上使用最佳图形 API。禁用此选项可添加和删除支持的图形 API。 | ||
Color Gamut for Mac | You can add or remove color gamuts for the Mac platform to use for rendering. Click the plus (+) icon to see a list of available gamuts. A color gamut defines a possible range of colors available for a given device (such as a monitor or screen). The sRGB gamut is the default (and required) gamut. Windows doesn’t support this property. | ||
Metal Write-Only Backbuffer | 允许在非默认设备方向上提高性能。此属性会在后缓冲区上设置 frameBufferOnly 标志,因此会阻止从后缓冲区的回读,但可实现一定程度的驱动程序优化。 | ||
Memoryless Depth | Choose when to use memoryless render textures. Memoryless render textures are temporarily stored in the on-tile memory when rendered, not in CPU or GPU memory. This reduces memory usage of your app but you cannot read or write to these render textures. Note: Memoryless render textures are only supported on iOS, tvOS 10.0+, Metal, and Vulkan. Render textures are read/write protected and stored in CPU or GPU memory on other platforms. |
||
Unused | 从不使用无记忆帧缓冲区深度。 | ||
Forced | 始终使用无记忆帧缓冲区深度。 | ||
Automatic | 让 Unity 决定何时使用无记忆帧缓冲区深度。 | ||
Static Batching | 启用此选项可使用静态批处理。 | ||
Dynamic Batching | 启用此选项可在构建中使用动态批处理(默认情况下启用)。 注意:当可编程渲染管线激活时,动态批处理无效,所以仅当 Scriptable Render Pipeline Asset Graphics 设置中未设置任何内容时,此设置才可见。 |
||
Compute Skinning | Enable this option to enable DX11/DX12/ES3 GPU compute skinning, freeing up CPU resources. | ||
Graphics Jobs | 启用此选项可指示 Unity 将图形任务(渲染循环)卸载到在其他 CPU 核心上运行的工作线程。此功能旨在减少主线程上 Camera.Render 所花费的时间,该时间通常成为瓶颈。 |
||
Lightmap Encoding | Choose Normal Quality or High Quality to set the lightmap encoding. This setting affects the encoding scheme and compression format of the lightmaps. | ||
HDR Cubemap Encoding | Choose Low Quality, Normal Quality, or High Quality to set the HDR Cubemap encoding. This setting affects the encoding scheme and compression format of the HDR Cubemaps. | ||
Lightmap Streaming | Whether to use Mipmap Streaming for lightmaps. Unity applies this setting to all lightmaps when it generates them. Note: To use this setting, you must enable the Texture Streaming Quality setting. |
||
Streaming Priority | Set the priority for all lightmaps in the Mipmap Streaming system. Unity applies this setting to all lightmaps when it generates them. Positive numbers give higher priority. Valid values range from –128 to 127. |
||
Frame Timing Stats | 启用此属性可收集 CPU 和 GPU 帧时间统计信息。此属性与动态分辨率摄像机设置同时使用可确定应用程序是受 CPU 还是受 GPU 限制。 | ||
Use Display In HDR Mode (Windows Only) | Enable this checkbox to make the game automatically switch to HDR mode output when it runs. This only works on displays that support this feature. If the display doesn’t support HDR mode, the game runs in standard mode. | ||
Swap Chain Bit Depth | 选择每个颜色通道中用于交换链缓冲区的位数。仅在启用 HDR 模式的情况下可用。 | ||
Bit Depth 10 | Unity uses the R10G10B10A2 buffer format and Rec2020 primaries with ST2084 PQ encoding. | ||
Bit Depth 16 | Unity uses the R16G16B16A16 buffer format and Rec709 primaries with linear color (no encoding). | ||
Load/Store Action Debug Mode | Highlights any undefined pixels that might cause rendering problems in your built application. The highlighting appears only in the Game view, and your built application if you select Development Build in Build Settings. For more information, refer to LoadStoreActionDebugModeSettings. | ||
Editor Only | Highlights the undefined pixels in the Game view, but not in your built application. |
Property | Description |
---|---|
SRGB Write Mode | Enable this option to allow Graphics.SetSRGBWrite() renderer to toggle the sRGB write mode during runtime. That is, if you want to temporarily turn off Linear-to-sRGB write color conversion, you can use this property to achieve that. Enabling this has a negative impact on performance on mobile tile-based GPUs; therefore, do NOT enable this for mobile. |
Number of swapchain buffers | Set this option to 2 for double-buffering, or 3 for triple-buffering to use with Vulkan renderer. This setting may help with latency on some platforms, but in most cases you should not change this from the default value of 3. Double-buffering might have a negative impact on performance. Do not use this setting on Android. |
Acquire swapchain image late as possible | If enabled, Vulkan delays acquiring the backbuffer until after it renders the frame to an offscreen image. Vulkan uses a staging image to achieve this. Enabling this setting causes an extra blit when presenting the backbuffer. This setting, in combination with double-buffering, can improve performance. However, it also can cause performance issues because the additional blit takes up bandwidth. |
Recycle command buffers | Indicates whether to recycle or free CommandBuffers after Unity executes them. |
Property | Description | |
---|---|---|
Scripting Backend | Choose the scripting backend you want to use. The scripting backend determines how Unity compiles and executes C# code in your Project. | |
Mono | Compiles C# code into .NET Common Intermediate Language (CIL) and executes that CIL using a Common Language Runtime. For more information, refer to the Mono page. | |
IL2CPP | Compiles C# code into CIL, converts the CIL to C++ and then compiles that C++ into native machine code, which executes directly at runtime. Refer to IL2CPP for more information. | |
API Compatibility Level | Choose which .NET APIs you can use in your project. This setting can affect compatibility with third-party libraries. However, it has no effect on Editor-specific code (code in an Editor directory, or within an Editor-specific Assembly Definition). Tip: If you are having problems with a third-party assembly, you can try the suggestion in the API Compatibility Level section below. |
|
.Net Standard 2.1 | Compatible with .NET Standard 2.1. Produces smaller builds and has full cross-platform support. | |
.Net Framework | Compatible with the .NET Framework 4 (which includes everything in the .NET Standard 2.0 profile plus additional APIs). Choose this option when using libraries that access APIs not included in .NET Standard 2.0. Produces larger builds and any additional APIs available aren’t necessarily supported on all platforms. Refer to Referencing additional class library assemblies for more information. | |
IL2CPP Code Generation | Defines how Unity manages IL2CPP code generation. This option is only available if you use the IL2CPP scripting backend. | |
Faster runtime | Generates code optimized for runtime performance. This setting is activated by default. | |
Faster (smaller) builds | Generates code optimized for build size and iteration. This setting generates less code and produces a smaller build, but can reduce runtime performance for generic code. Use this option when faster build times are important, such as when iterating on changes. | |
C++ Compiler Configuration | Choose the C++ compiler configuration used when compiling IL2CPP generated code. Note: This property is disabled unless Scripting Backend is set to IL2CPP. |
|
Use incremental GC | Uses the incremental garbage collector, which spreads garbage collection over several frames to reduce garbage collection-related spikes in frame duration. For more information, refer to Automatic Memory Management. | |
Allow downloads over HTTP | Indicates whether to allow downloading content over HTTP. The options are Not allowed, Allowed in Development builds only, and Always allowed. The default option is Not allowed due to the recommended protocol being HTTPS, which is more secure. | |
Active Input Handling | Choose how to handle input from users. | |
Input Manager (old) | Use the default Input window. | |
Input System Package (New) | Use the newer Input system. To try the new Input System, install the InputSystem package. | |
Both | Use both systems side by side. |
可为所有目标选择 mono API 兼容性级别。有时,第三方 .NET 库会使用 .NET 兼容性级别之外的功能。为了解在这种情况下可能发生的问题以及如何以最佳方案修复问题,请尝试以下解决方案:
Frameworks/Mono/lib/mono/YOURSUBSET/
.Use these settings to control how much memory shaders use at runtime.
属性 | 描述 |
---|---|
Default chunk size (MB) | Sets the maximum size of compressed shader variant data chunks Unity stores in your built application for all platforms. The default is 16 . For more information, refer to Shader loading. |
Default chunk count | Sets the default limit on how many decompressed chunks Unity keeps in memory on all platforms. The default is 0 , which means there’s no limit. |
Override | Enables overriding Default chunk size and Default chunk count for this build target. |
Chunk size (MB) | Overrides the value of Default chunk size (MB) on this build target. |
Chunk count | Overrides the value of Default chunk count on this build target. |
设置 | 功能 |
---|---|
Scripting Define Symbols | Set custom compilation flags. For more details, refer to Platform dependent compilation. |
Additional Compiler Arguments | Add entries to this list to pass additional arguments to the Roslyn compiler. Use one new entry for each additional argument. To create a new entry, press the ‘+’ button. To remove an entry, press the ‘-’ button. When you have added all desired arguments, click the Apply button to include your additional arguments in future compilations. The Revert button resets this list to the most recent applied state. |
Suppress Common Warnings | Disable this setting to display the C# warnings CS0169 and CS0649. |
Allow ‘unsafe’ Code | 允许在预定义的程序集(例如,Assembly-CSharp.dll )中编译“不安全”的 C# 代码。对于程序集定义文件 ( .asmdef ),请单击其中一个 .asmdef 文件,并在出现的 Inspector 窗口中启用该选项。 |
Use Deterministic Compilation | Disable this setting to prevent compilation with the -deterministic C# flag. With this setting enabled, compiled assemblies are byte-for-byte identical each time they’re compiled. For more information, refer to Microsoft’s deterministic compiler option documentation. |
Property | Description | |
---|---|---|
Prebake Collision Meshes | Adds collision data to Meshes at build time. | |
Keep Loaded Shaders Alive | Indicates whether to prevent shaders from being unloaded. For more information, see Shader Loading. |
|
Preloaded Assets | Sets an array of Assets for the player to load on startup. To add new Assets, increase the value of the Size property and then set a reference to the Asset to load in the new Element box that appears. |
|
AOT compilation options | Additional options for Ahead of Time (AOT) compilation. This helps optimize the size of the built iOS player. | |
Strip Engine Code | Enable this option if you want the Unity Linker tool to remove code for Unity Engine features that your Project doesn’t use. This setting is only available with the IL2CPP scripting backend. Most apps don’t use every available DLL. This option strips out DLLs that your app doesn’t use to reduce the size of the built Player. If your app is using one or more classes that would normally be stripped out under your current settings, Unity displays a debug message when you try to build the app. |
|
Managed Stripping Level | Chooses how aggressively Unity strips unused managed (C#) code. The options are Minimal, Low, Medium, and High. When Unity builds your app, the Unity Linker process can strip unused code from the managed DLLs your Project uses. Stripping code can make the resulting executable significantly smaller, but can sometimes accidentally remove code that’s in use. For more information about these options and bytecode stripping with IL2CPP, refer to ManagedStrippingLevel. |
|
Vertex Compression | Sets vertex compression per channel. This affects all the meshes in your project. Typically, Vertex Compression is used to reduce the size of mesh data in memory, reduce file size, and improve GPU performance. For more information on how to configure vertex compression and limitations of this setting, refe to Compressing mesh data. |
|
Optimize Mesh Data | Enable this option to strip unused vertex attributes from the mesh used in a build. This option reduces the amount of data in the mesh, which can help reduce build size, loading times, and runtime memory usage. Warning: If you have this setting enabled, you should remember to not change material or shader settings at runtime. Refer to PlayerSettings.stripUnusedMeshComponents for more information. |
|
Texture MipMap Stripping | Enables mipmap stripping for all platforms. This strips unused mipmaps from Textures at build time. Unity determines unused mipmaps by comparing the value of the mipmap against the Quality Settings for the current platform. If a mipmap value is excluded from every Quality Setting for the current platform, then Unity strips those mipmaps from the build at build time. If QualitySettings.masterTextureLimit is set to a mipmap value that has been stripped, Unity will set the value to the closest mipmap value that has not been stripped. |
See stack trace logging for more information.
属性 | 功能 |
---|---|
Clamp BlendShapes (Deprecated) | Enable the option to clamp the range of blend shape weights in SkinnedMeshRenderers. |