i.e if it is an ipad(any) or iPhoneX then i want to open a different scene. How do I do it?
if(...detect iPad(any) or iPhoneX ...) {
SceneManager.LoadScene("SpecificScene");
}
Thank you
i.e if it is an ipad(any) or iPhoneX then i want to open a different scene. How do I do it?
if(...detect iPad(any) or iPhoneX ...) {
SceneManager.LoadScene("SpecificScene");
}
Thank you
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
}