[펌] How to detect iPhone X or iPad using iOS.DeviceGeneration?
Unity3D/Tips / 2018. 3. 9. 20:45
You can check against UnityEngine.iOS.Device.generation.
Note that you'll need Unity 2017.2 or higher to detect iPhone X.
Unity 5.6.5f1 also seems to support the iPhoneX enum, even though it's not listed in the 5.6 docs.
bool deviceIsIphoneX = UnityEngine.iOS.Device.generation == UnityEngine.iOS.DeviceGeneration.iPhoneX;
if (deviceIsIphoneX) {
// Do something for iPhone X
}
To check against iPad, you could probably go:
bool deviceIsIpad = UnityEngine.iOS.Device.generation.ToString().Contains("iPad");
if (deviceIsIpad) {
// Do something for iPad
}
[출처] https://answers.unity.com/questions/1432365/how-to-detect-iphone-x-or-ipad-using-iosdevicegene.html
반응형
'Unity3D > Tips' 카테고리의 다른 글
Unity app stops background music(앱 실행 시, 타 앱 사운드 끄기) (0) | 2018.04.19 |
---|---|
[펌/수정] Get size of an online assetbundle and progress in Kb ? (0) | 2018.04.18 |
[링크] Unity3D 자동 GetComponent (0) | 2018.02.26 |
[펌] 지역 코드 얻어오기 (0) | 2018.02.22 |
[링크] Google Analytics 연동하기 (0) | 2018.02.22 |