Version: 2023.2
言語: 日本語

DeviceGeneration

enumeration

マニュアルに切り替える

説明

iOS デバイスの世代

                    
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); } }

変数

iPhoneiPhone 第1世代
iPhone3GiPhone 第2世代
iPhone3GSiPhone 第3世代
iPodTouch1GeniPod Touch 第1世代
iPodTouch2GeniPod Touch 第2世代
iPodTouch3GeniPod Touch 第3世代
iPad1GeniPad 第1世代
iPhone4iPhone 第4世代
iPodTouch4GeniPod Touch 第4世代
iPad2GeniPad 第2世代
iPhone4SiPhone 第5世代
iPad3GeniPad 第3世代
iPhone5iPhone5
iPodTouch5GeniPod Touch 第5世代
iPadMini1GeniPad Mini, first generation.
iPad4GeniPad 第4世代
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 (第4世代)
iPhoneSE1GeniPhone SE (第1世代)
iPadPro10Inch1GeniPad Pro 9.7" (第1世代)
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 (第5世代)
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.
iPhoneUnknown世代不明の iPhone
iPadUnknown世代不明の iPad
iPodTouchUnknown世代不明の iPod Touch
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961