Version: 2019.2
Soporte para el Controlador del Juego iOS
Optimizing Performance on iOS

Advanced iOS scripting

Device properties

Hay un número de propiedades específicas al dispositivo que puedes acceder. Puedes ver las páginas de referencia de script de SystemInfo.deviceUniqueIdentifier, SystemInfo.deviceName, SystemInfo.deviceModel y SystemInfo.operatingSystem.

Anti-piracy check

A common way of hacking an application is by removing the AppStore DRM protection and then redistributing it for free. Use Unity’s anti-piracy check to find out if your application was altered after it was submitted to the AppStore.

Check if your application is genuine (not hacked) with the Application.genuine property. This is useful to alert users they are using a hacked application, or to disable certain functions, if the property returns false.

Note: Application.genuineCheckAvailable should be used along with Application.genuine to verify that application integrity can be confirmed. Accessing the Application.genuine property is a resource-intensive operation and so you shouldn’t perform it during frame updates or other time-critical code.

Vibration support

You can trigger a vibration by calling Handheld.Vibrate. Devices without vibration hardware ignore this call.

Activity indicator

Mobile operating systems have built-in activity indicators you can use during slow operations. See the documentation on Handheld.StartActivityIndicator docs for examples.

Screen orientation

You can control the screen orientation of your application on both ios and Android devices. Detecting a change in orientation or forcing a specific orientation is useful for creating game behaviors that depend on how the user is holding the device.

Retrieve device orientation by accessing the Screen.orientation property. Orientation can be one of the following:

Orientation Behavior
Portrait The device is in portrait mode, with the device held upright and the home button at the bottom.
PortraitUpsideDown El dispositivo está en modo portrait pero al revés, sostenido en posición vertical y con el botón home en la parte superior.
LandscapeLeft El dispositivo está en modo landscape, sostenido en posición vertical y el botón home a la derecha.
LandscapeRight El dispositivo está en modo landscape, sostenido en posición vertical y con el botón home a la izquierda.

Set Screen.orientation to one of the above orientations, or use ScreenOrientation.AutoRotation to control the screen orientation. When you enable auto-rotation, you can still disable some orientation on a case-by-case basis.

See the API documentation for Screen.autorotateToPortrait, Screen.autorotateToPortraitUpsideDown, Screen.autorotateToLandscapeLeft and Screen.autorotateToLandscapeRight for more information.

Determining device generation

Different device generations have varied performance and support different functionalities. Use the iOS.DeviceGeneration property to query the device’s generation.

See the iPhone Hardware Guide documentation for more information about different device generations, performance, and supported functionality.

Display cutout

On some displays, certain areas of the screen might be obscured or non-functional because of other hardware occupying that space. Use Screen.cutouts to return a list of bounding boxes surrounding each cutout.

iOS devices do not provide a native API to get the display cutout information, so the cutouts are hardcoded in the Xcode project for each available iOS device. You can modify existing data or add additional devices in the Unity Xcode project ReportSafeAreaChangeForView function, which is in the file.

See the API documentation on Screen.cutouts for more information on using this function.

Soporte para el Controlador del Juego iOS
Optimizing Performance on iOS
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。