Version: Unity 6 Beta (6000.0)
LanguageEnglish
  • C#

DeviceGeneration

enumeration

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

iOS device generation.

using UnityEngine;
using UnityEngine.iOS;

public class DeviceGenerationExample : MonoBehaviour { string m_DeviceGeneration = "Undefined";

void Start() { // Check if the device running this is an "iPhone 14 Pro Max" if (Device.generation == DeviceGeneration.iPhone14ProMax) { m_DeviceGeneration = "iPhone 14 Pro Max"; } // Check if the device running this is an 'iPad Mini (6th generation)" if (Device.generation == DeviceGeneration.iPadMini6Gen) { m_DeviceGeneration = "iPad Mini (6th generation)"; } // Check if the device running this is an "iPod Touch (7th generation)" if (Device.generation == DeviceGeneration.iPodTouch7Gen) { m_DeviceGeneration = "iPod Touch (7th generation)"; }

// Check if the device running this is an unknown iPhone if (Device.generation == DeviceGeneration.iPhoneUnknown) { m_DeviceGeneration = "Unknown iPhone"; } // Check if the device running this is an unknown iPad if (Device.generation == DeviceGeneration.iPadUnknown) { m_DeviceGeneration = "Unknown iPad"; } // Check if the device running this is an unknown iPod Touch if (Device.generation == DeviceGeneration.iPodTouchUnknown) { m_DeviceGeneration = "Unknown iPod Touch"; } // Output the device generation to the console/device log Debug.Log("Device generation: " + m_DeviceGeneration); } }

Properties

iPhoneiPhone, first generation.
iPhone3GiPhone, second generation.
iPhone3GSiPhone, third generation.
iPodTouch1GeniPod Touch, first generation.
iPodTouch2GeniPod Touch, second generation.
iPodTouch3GeniPod Touch, third generation.
iPad1GeniPad, first generation.
iPhone4iPhone, fourth generation.
iPodTouch4GeniPod Touch, fourth generation.
iPad2GeniPad, second generation.
iPhone4SiPhone, fifth generation.
iPad3GeniPad, third generation.
iPhone5iPhone5.
iPodTouch5GeniPod Touch, fifth generation.
iPadMini1GeniPad Mini, first generation.
iPad4GeniPad, fourth generation.
iPhone5CiPhone 5C.
iPhone5SiPhone 5S.
iPadAir1iPad Air.
iPadMini2GeniPad Mini, second generation.
iPhone6iPhone 6.
iPhone6PlusiPhone 6 plus.
iPadMini3GeniPad Mini, third generation.
iPadAir2iPad Air 2.
iPhone6SiPhone 6S.
iPhone6SPlusiPhone 6S Plus.
iPadPro1GeniPad Pro 12.9", first generation.
iPadMini4GeniPad Mini, fourth generation.
iPhoneSE1GeniPhone SE, first generation.
iPadPro10Inch1GeniPad Pro 9.7", first generation.
iPhone7iPhone 7.
iPhone7PlusiPhone 7 Plus.
iPodTouch6GeniPod Touch, sixth generation.
iPad5GeniPad, fifth generation.
iPadPro2GeniPad Pro 12.9", second generation.
iPadPro10Inch2GeniPad Pro 10.5", second generation 10" iPad.
iPhone8iPhone 8.
iPhone8PlusiPhone 8 Plus.
iPhoneXiPhone X.
iPhoneXSiPhone XS.
iPhoneXSMaxiPhone XSMax.
iPhoneXRiPhone XR.
iPadPro11InchiPad Pro 11", first generation.
iPadPro3GeniPad Pro 12.9", third generation.
iPad6GeniPad, sixth generation.
iPadAir3GeniPad Air, third generation.
iPadMini5GeniPad Mini, fifth generation.
iPhone11iPhone 11.
iPhone11ProiPhone 11 Pro.
iPhone11ProMaxiPhone 11 Pro Max.
iPodTouch7GeniPod Touch, seventh generation.
iPad7GeniPad, seventh generation.
iPhoneSE2GeniPhone SE, second generation.
iPadPro11Inch2GeniPad Pro 11", second generation.
iPadPro4GeniPad Pro 12.9", fourth generation.
iPhone12MiniiPhone 12 Mini.
iPhone12iPhone 12.
iPhone12ProiPhone 12 Pro.
iPhone12ProMaxiPhone 12 Pro Max.
iPad8GeniPad, eighth generation.
iPadAir4GeniPad Air, fourth generation.
iPad9GeniPad, ninth generation.
iPadMini6GeniPad Mini, sixth generation.
iPhone13iPhone 13.
iPhone13MiniiPhone 13 Mini.
iPhone13ProiPhone 13 Pro.
iPhone13ProMaxiPhone 13 Pro Max.
iPadPro5GeniPad Pro 12.9", fifth generation.
iPadPro11Inch3GeniPad Pro 11", third generation.
iPhoneSE3GeniPhone SE, third generation.
iPadAir5GeniPad Air, fifth generation.
iPhone14iPhone 14.
iPhone14PlusiPhone 14 Plus.
iPhone14ProiPhone 14 Pro.
iPhone14ProMaxiPhone 14 Pro Max.
iPadPro6GeniPad Pro 12.9", sixth generation.
iPadPro11Inch4GeniPad Pro 11", fourth generation.
iPad10GeniPad, tenth generation.
iPhone15iPhone 15.
iPhone15PlusiPhone 15 Plus.
iPhone15ProiPhone 15 Pro.
iPhone15ProMaxiPhone 15 Pro Max.
iPhoneUnknownYet unknown iPhone.
iPadUnknownYet unknown iPad.
iPodTouchUnknownYet unknown iPod Touch.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961