iOS 硬件指南
iOS 2D 纹理覆盖

iOS Player Settings

This page details the Player Settings specific to iOS. A description of the general Player Settings can be found here.

Note that Unity iOS requires iOS 7.0 or higher. Unity does not support iOS 6.0 or earlier versions.

Icon

Note: If any icon textures are omitted, the icon texture with the nearest size is scaled accordingly (preference is given to larger resolution textures).

属性: 功能:
Application icons 为每个 iOS 设备分配您希望出现在应用程序上的自定义图标。
Spotlight icons 为每个 iOS 设备分配要在 Spotlight 搜索结果中针对您的游戏显示的自定义图标。
Settings icons 为每个 iOS 设备分配要显示在手机主设置页面上的自定义图标。
Notification icons 为每个 iOS 设备分配您的游戏发送通知时您希望显示的自定义图标。
Marketing icons 为每个 iOS 设备分配要在 App Store 中针对您的游戏显示的自定义图标。

Resolution and Presentation

属性: 功能:
Resolution Scaling
Resolution Scaling Mode Set the scaling to be equal to or below the native screen resolution:
FixedDPI allows you to scale the device’s screen resolution below its native resolution and show the Target DPI property. Use this to optimize performance and battery life or target a specific DPI setting.
Disabled ensures that scaling is not applied and the game renders to its native screen resolution.
Target DPI Set the target DPI of the game screen. The game screen is downscaled to match this setting if the device’s native screen DPI is higher than this value. This option only appears when the Resolution Scaling Mode is set to Fixed DPI.
Orientation
Default Orientation
This setting is shared between iOS and Android devices
The game’s screen orientation. The options are:
Portrait (home button at the bottom),
Portrait Upside Down (home button at the top),
Landscape Left (home button on the right side),
Landscape Right (home button on the left side), and
Auto Rotation (screen orientation changes with device orientation)
Use Animated Autorotation Check this box if you want orientation changes to animate the screen rotation rather than just switch. This is only visible when Default Orientation is set to Auto Rotation.
Allowed Orientations for Auto Rotation (only visible when Default Orientation is set to Auto Rotation.)
Portrait 允许纵向方向。
Portrait Upside Down 允许纵向上下翻转方向。
Landscape Right 允许横向右侧方向(主屏幕按钮位于左侧)。
Landscape Left 允许横向左侧方向(主屏幕按钮位于右侧)。
Multitasking Support
Requires Fullscreen Check this box if your game requires fullscreen.
Status Bar
Status Bar Hidden Check this box to hide the the status bar when the application launches.
Status Bar Style 定义应用程序启动时状态栏的样式。选项为 DefaultBlack TranslucentBlack Opaque
Disable Depth and Stencil Check this box to disable the depth and stencil buffers.
Show Loading Indicator Select how the loading indicator be displayed. The options are Don’t Show, White Large, White, and Gray.

Splash Image

There are two ways to implement splash images on iOS: Launch Images and Launch Screens.

Launch Images

Launch Images are static splash screen images that occupy the entire screen.

Launch Images are defined in an Asset catalog (Images.xcassets/LaunchImage). Always add a Launch Screen for each supported size and orientation combination.

Only iPhone 6+ supports landscape orientation; other iPhones can only use portrait. Launch Images are selected in the following order:

  • 如果设置了纹理,则特定__启动图像__优先
  • 默认的 Unity 启动画面启动图像,也就是纯蓝黑色

您需要为自己的构建版本设置所有__启动图像__。

Launch Screens

A Launch Screen is an XIB file from which iOS creates a splash screen dynamically on the device.

Launch Screens have a limitation: it is not possible to display different content depending on iPad device orientation. All iPhones support landscape Launch Screens; however, due to a bug in iOS, Landscape Left is shown instead of Landscape Right on certain iOS versions.

Note: For advice on cross-platform Splash Image properties, see Splash Screen settings.

属性: 功能:
Virtual Reality Splash Image Specify the texture that should be used for the iOS splash screen on a Virtual Reality application.
Use Storyboard for Launch Enable this option to show the Custom Storyboard button. Click the button to select a storyboard to show when your game starts up on the device. For your storyboard to appear here, you firstly need to create the storyboard in Xcode and copy it to your Project.
Legacy Launch Images
Mobile Splash Screen 指定要用于 iOS 启动画面的纹理。标准启动画面大小为 320x480。(iOS 和 Android 之间共享此设置。)
iPhone 3.5"/Retina 指定要用于 iOS 3.5" Retina 启动画面的纹理。启动画面大小为 640x960。
iPhone 4"/Retina 指定要用于 iOS 4" Retina 启动画面的纹理。启动画面大小为 640x1136。
iPhone 4.7"/Retina 指定要用于 iOS 4.7" Retina 启动画面的纹理。启动画面大小为 750x1334。
iPhone 5.5"/Retina 指定要用于 iOS 5.5" Retina 启动画面的纹理。启动画面大小为 1242x2208。
iPhone 5.5" Landscape/Retina 指定要用于 iOS 5.5" 横向/Retina 启动画面的纹理。启动画面大小为 2208x1242。
iPhone X\Retina 指定要用于 iPhone X Retina 启动画面的纹理。启动画面大小为 1125x2436。
iPhone X Landscape\Retina 指定要用于 iPhone X 横向/Retina 启动画面的纹理。启动画面大小为 2436x1125。
iPad Portrait 指定要用作 iPad 纵向启动画面的纹理。标准启动画面大小为 768x1024。
iPad Landscape 指定要用作 iPad 横向启动画面的纹理。标准启动画面大小为 1024x768。
iPad Portrait/Retina 指定要用作 iPad Retina 纵向启动画面的纹理。标准启动画面大小为 1536x2048。
iPad Landscape/Retina 指定要用作 iPad Retina 横向启动画面的纹理。标准启动画面大小为 2048x1536。
Launch Screen type Allows you to select between the launch screen types
- None 这种行为就好像只使用了启动图像一样。
- Default 一个与启动图像 (Launch Image) 非常相似的启动屏幕 (Launch Screen)。选择一张图像用于纵向和横向。选择顺序:iPhone 6+ 启动图像、共享移动端启动图像、iPhone 6+ 默认 Unity 启动图像。系统将使用宽高填充模式来显示图像。
- Image with background, relative size A center-aligned image is shown, with the rest of area filled with solid color. The image size is user-specified percentage of the screen size, computed in the smaller dimension (vertical on landscape, horizontal in portrait orientations). User also specifies background color and images for portrait and landscape orientations. Image selection order: the user-specified image, shared mobile launch image, default Unity launch image for iPhone 6+. The images are displayed using aspect-fill mode.
- Image with background, constant size 与 relative size 选项相同,但图像的大小是由用户指定的点数来定义的。
- Custom Xib An user-specified XIB file from any location.

In Unity Personal Edition the Unity Splash Screen displays as soon as engine initializes, in addition to your chosen splash screen.

Debugging and crash reporting

属性: 功能:
Enable Internal Profiler (Deprecated) 启用内部性能分析器,它可收集应用程序的性能数据并将报告输出至控制台。报告包含每个 Unity 子系统在每帧上执行时所用的毫秒数。数据是针对 30 帧所求的平均值。
On .Net UnhandledException 对 .NET 未处理异常所采取的操作。提供的选项为 Crash__(应用程序几乎崩溃并且强制 iOS 生成可通过应用程序用户提交到 iTunes 并由开发人员检查的崩溃报告)和 Silent Exit__(应用程序成功退出)。
Log ObjC uncaught exceptions Enables a custom Objective-C Uncaught Exception handler, which will print exception information to console.
Enable Crash Report API Enables a custom crash reporter to capture crashes. Crash logs will be available to scripts via CrashReport API.

Other Settings

属性: 功能:
Rendering
Color Space Make Unity use Gamma color space or Linear color space for rendering. For more information, see linear rendering documentation. Linear color space is only supported on Metal graphics API.
Auto Graphics API Allows you to select which graphics API is used. When checked, Unity will include Metal, and GLES2 as a fallback for devices where Metal is not supported. When unchecked, you can manually pick and reorder the graphics APIs. Manually picking just one API will adjust your app’s info.plist which will result in appropriate app store restrictions.
Graphics APIs Set the graphics APIs to use for rendering. Click the + icon to add an API and the - icon to remove an API. When a device supports more than one Graphics API, Unity uses the first item in the ordered list. Click and drag an API in the list to change the order. This will only appear when Auto Graphics API is unchecked.
Color Gamut Set the color gamut to use for rendering. When targeting recent iOS devices with wide color gamut displays, use DisplayP3 to utilize full display capabilities. Use Metal Editor Support as a fallback for older devices.
Metal Editor Support Makes the Unity Editor use the Metal API and unlocks faster shader iteration for targeting the Metal API. Metal API Validation can help catch graphics-related errors early, although it might decrease performance. For more information, see Validating Metal API.
Force hard shadows on Metal Forces Unity to use point sampling for shadows on Metal. This reduces shadow quality, which should give better performance.
Metal Restricted Backbuffer Use 允许在非默认设备方向上提高性能。此属性会在后缓冲区上设置 frameBufferOnly 标志,因此会阻止从后缓冲区的回读,但可实现一定程度的驱动程序优化。
Multithreaded Rendering Enable multithreaded rendering. This is only supported on Metal.
Static Batching Set this to use Static batching on your build (enabled by default).
Dynamic Batching Set this to use Dynamic Batching on your build.
GPU Skinning Should DX11/ES3 GPU skinning be enabled?
Identification
Bundle Identifier The string used in your provisioning certificate from your Apple Developer Network account. (This is shared between iOS and Android.)
Bundle Version Specifies the build version number of the bundle, which identifies an iteration (released or unreleased) of the bundle. The version is specified in the common format of a string containing numbers separated by dots (eg, 4.3.2).
Build The build number can be entered here to allow you to keep track of the number of builds that have been made.
Signing Team ID Set this property with your Apple Developer Team ID. You can find this on the Apple Developer website under Account > Membership. This sets the Team ID for the generated Xcode project, allowing developers to use the Build and Run functionality. An Apple Developer Team ID must be set here for automatic signing of your app. For more information, see Creating Your Team Provisioning Profile.
Automatically Sign Enable this to allow Xcode to automatically sign your build.
iOS Provisioning Profile Specify an Apple provisioning profile to allow your game to run on all your iOS devices and use app services. Click the Browse button to select a downloaded provisioning profile file. The Profile ID is the internal ID of the provisioning profile set in the Xcode project, for example: 1234abcd-12ab-12ab-12ab-1234abcd1234. This appears automatically when you select a provisioning profile file, or you can enter it manually.
Note: This property only appears when Automatically Sign is unchecked.
Configuration
Scripting Runtime Version 选择要在项目中使用的 .NET 运行时。有关更多详细信息,请参阅 Microsoft 的 .NET 文档
     .NET 3.5 Equivalent 一个实现 .NET 3.5 API 的 .NET 运行时。这是默认脚本运行时。
     .NET 4.x Equivalent 一个实现 .NET 4 API 的 .NET 运行时。此 API 比 .NET 3.5 更新,因此提供对更多 API 的访问、与更多外部库兼容并支持 C# 6。
Scripting Backend Allows you to select between IL2CPP and Mono scripting backends. The default is IL2CPP, and in most normal situations there should be no reason to switch to the older Mono backend. Unless you are running into bugs specifically relating to IL2CPP, you should not select Mono. Mono builds are no longer accepted in the App store and Mono is not supported by iOS 11 and above.
Api Compatibility Level Specifies active .NET API profile. See below:
- .Net 2.0 .Net 2.0 库。最高的 .net 兼容性,最大的文件大小。
- .Net 2.0 Subset 完整 .net 兼容性的子集,最小的文件大小。
C++ Compiler Configuration Choose whether to compile your IL2CPP generated code in Debug or Release mode:
- Debug Use Debug mode for debugging because it turns off all optimizations. This makes the code quicker to build but slower to run.
- Release Use Release mode for testing and delivery to users because it enables optimizations. This makes the compiled code run faster and the binary size smaller, but it takes longer to compile.
Use on Demand Resource When enabled, allows you to use on-demand resources.
Accelerometer Frequency How often is the accelerometer sampled? The options are Disabled (i.e. no samples are taken), 15Hz, 30Hz, 60Hz and 100Hz.
Camera Usage Description Allows you to enter the reason for accessing the camera on the iOS device.
Location Usage Description Allows you to enter the reason for accessing the location of the iOS device.
Microphone Usage Description Allows you to enter the reason for accessing the microphone on the iOS device.
Mute Other Audio Sources Enable this if you want your Unity application to stop audio from applications running in the background. Disable this if you want audio from background applications to continue playing alongside your Unity application.
Prepare iOS for Recording When selected, the microphone recording APIs are initialised. This makes recording latency lower, though on iPhones it re-routes audio output via earphones only.
Force iOS Speakers when Recording Make the phone output through the internal speakers, even when headphones are plugged in and recording.
Requires Persistent WiFi Specifies whether the application requires a Wi-Fi connection. iOS maintains the active Wi-Fi connection while the application is running.
Allow downloads over HTTP (nonsecure) When this option is enabled it will allow you to download content over HTTP. Default and recommended is HTTPS.
Supported URL schemes A list of supported URL schemes.
Disable HW Statistics By default, Unity iOS apps send anonymous HW statistics to Unity so we can provide you with aggregated information to help you make decisions as a developer. These stats can be found at http://stats.unity3d.com/. Checking this option disables the sending of these statistics for your app.
Target Device Which devices are targeted by the game? The options are iPhone Only, iPad Only and iPhone + iPad.
Target SDK Which SDK is targeted by the game? The options are iPhone Only, Device SDK and Simulator SDK.
Target minimum iOS Version Defines the minimum version of iOS that the game will work.
Enable ProMotion Support Enable high frequency refresh rates (120 Hz) on ProMotion displays. Enabling this setting might affect battery life.
Requires ARKit support Restricts the app to iPhone 6s/iOS 11 or newer devices when publishing to the App Store.
Defer system gestures on edges Users must swipe twice on the selected edges to enact system gesture.
Hide home button on iPhone X Hide the home button on iPhone X devices when the app is running.
Render Extra Frame on Pause Issue an additional frame after the frame when the app is paused. This allows your app to show graphics that indicate the paused state when the app is going into the background.
Behaviour in Background Specifies what the application should do when the user presses the home button.
- Suspend This is the standard behaviour; the app is suspended, but not quit.
- Exit Instead of suspending, the app will quit when the home button is pressed.
- Custom You can implement your own behaviour with background processing. See an example here.
Architecture Allows you to select which architecture to target. Universal is recommended default. Some apps that are shipping on high-end devices only might consider selecting the Arm64-only option. Armv7 is for consistency purposes.
- Universal The recommended option. Supports both architectures.
- Armv7 Support only the older Armv7 architecture.
- Arm64 Support only the newer Arm64 architecture.
- x86_64 Only architecture available for Simulator SDK. Supports the x86_64 architecture.
Scripting Define Symbols 自定义的编译标志(请参阅平台相关的编译页面以了解详细信息)。
Allow ‘unsafe’ Code 允许在预定义的程序集(例如,Assembly-CSharp.dll)中编译“不安全”的 C# 代码。对于程序集定义文件 (.asmdef),请单击其中一个 .asmdef 文件,并在出现的 Inspector 窗口中启用该选项。
Active Input Handling Choose to handle input using the Input Manager, the Input System (Preview), or Both. If you change this setting, you must restart Unity for the change to take effect.
Optimization
Prebake Collision Meshes Should collision data be added to meshes at build time?
Keep Loaded Shaders Alive Retains shaders in memory for faster access when the player starts the game up.
Preloaded Assets An array of assets to be loaded when the player starts up.
AOT compilation options Additional AOT compiler options.
Strip Engine Code Enable code stripping. (This setting is only available with the IL2CPP scripting backend.)
Script Call Optimization Optionally disable exception handling for a speed boost at runtime. See iOS Optimization for details.
- Slow and Safe Full exception handling will occur (with some performance impact on the device when using the Mono scripting backend).
- Fast but no Exceptions No data provided for exceptions on the device (the game will run faster when using the Mono scripting backend).
Vertex Compression Select which vertex channels should be compressed. Compression can save memory and bandwidth but precision will be lower.
Optimize Mesh Data 从网格中删除应用于网格的材质不需要的所有数据(切线、法线、颜色、UV)。

Note: Be sure to select the correct SDK - if you select Device, say, but then target the Simulator in Xcode then the build will fail with a lot of error messages.

API Compatibility Level

You can choose your Mono API compatibility level for all targets. Sometimes a 3rd party .net dll will use things that are outside of the .NET compatibility level that you would like to use. To understand what is going on in such cases, and how to best fix it, get “Reflector” on Windows.

  1. Drag the .NET assemblies for the api compatilibity level in question into reflector. You can find these in Frameworks/Mono/lib/mono/YOURSUBSET/
  2. Also drag in your 3rd party assembly.
  3. Right click your 3rd party assembly, and select “Analyze”.
  4. In the analysis report, inspect the “Depends on” section. Anything that the 3rd party assembly depends on, but is not available in the .NET compatibility level of your choice will be highlighted in red there.

Bundle Identifier

The Bundle Identifier string must match the provisioning profile of the game you are building. The basic structure of the identifier is com.CompanyName.GameName. This structure may vary internationally based on where you live, so always default to the string provided to you by Apple for your Developer Account. Your GameName is set up in your provisioning certificates, that are manageable from the Apple iPhone Developer Center website. Please refer to the Apple iPhone Developer Center website for more information on how this is performed.

Stripping level

Most games don’t use all necessary dlls. With the Strip Engine Code option enabled, you can strip out unused parts to reduce the size of the built player on iOS devices. If your game is using classes that would normally be stripped out by the option you currently have selected, you’ll be presented with a Debug message when you make a build.

Script call optimization

A good development practice on iOS is to never rely on exception handling (either internally or through the use of try/catch blocks). When using the default Slow and Safe option, any exceptions that occur on the device will be caught and a stack trace will be provided. When using the Fast but no Exceptions option, any exceptions that occur will crash the game, and no stack trace will be provided. In addition, the AppDomain.UnhandledException event will be raised to allow project-specific code access to the exception information.

With the Mono scripting backend, the game will run faster since the processor is not diverting power to handle exceptions. There is no performance benefit with the Fast but no Exceptions option when using the IL2CPP scripting backend. When releasing your game to the world, it’s best to publish with the Fast but no Exceptions option.

XR settings

属性: 功能:
XR Settings
Virtual Reality Supported 为 Unity Editor 和游戏版本启用本机 VR 支持。
Vuforia Augmented Reality Supported 启用 Vuforia 软件开发工具包。必须拥有 Vuforia 软件许可证,并在启用该属性之前同意该许可证的条款。

增量构建

由 IL2CPP 脚本后端生成的 C++ 代码可以逐步更新,从而允许增量式 C++ 构建系统仅编译更改的源文件。这种方式可以显著降低 IL2CPP 脚本后端的迭代次数。

To use incremental builds, choose the “Append” option after selecting “Build” from the “Build Settings” dialog. The “Replace” option will perform a clean build.


  • 2018–06–28 页面已修订并进行了编辑审查

  • 在 5.5 版中添加了 Mute Other Audio Sources 选项

  • 在 Unity 2018.1 中更新了 iOS Player Settings 文档

  • 在 Unity 2018.1 中添加了 Allow ‘unsafe’ Code 复选框

  • 在 2018.1 版中添加了 .NET 4.x 运行时

iOS 硬件指南
iOS 2D 纹理覆盖
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961