- Home /
How to Read iOS Device With Unity 5?
Hello,
I am trying to resize screen view of my game by reading the iOS device. Actually, i only resize it for iPAD devices. But the code i give below doesn't seem to work. When i run the project in iPAD simulator of xCODE, it doesn't read the code and resize the game. What's wrong with these codes or what should i use to read the iOS devide?
if(UnityEngine.iOS.Device.generation == UnityEngine.iOS.DeviceGeneration.iPad1Gen ||
UnityEngine.iOS.Device.generation == UnityEngine.iOS.DeviceGeneration.iPad2Gen ||
UnityEngine.iOS.Device.generation == UnityEngine.iOS.DeviceGeneration.iPad3Gen ||
UnityEngine.iOS.Device.generation == UnityEngine.iOS.DeviceGeneration.iPad4Gen ||
UnityEngine.iOS.Device.generation == UnityEngine.iOS.DeviceGeneration.iPad5Gen ||
UnityEngine.iOS.Device.generation == UnityEngine.iOS.DeviceGeneration.iPadMini1Gen ||
UnityEngine.iOS.Device.generation == UnityEngine.iOS.DeviceGeneration.iPadMini2Gen||
UnityEngine.iOS.Device.generation == UnityEngine.iOS.DeviceGeneration.iPadMini3Gen)
{
ipadDevices = true;
}
I was using iPhoneSettings.generation == iPhoneGeneration.iPad1Gen
in Unity 4.x but it seems that it's changed as this in unity 5; UnityEngine.iOS.Device.generation == UnityEngine.iOS.DeviceGeneration.iPadMini3Gen
. I got no error when i type this but i think there is still something wrong.
What could be the problem?
I don't know if it is because of iOS 9 but still not working even if i update unity or try to get screen resolution with Screen.width and Screen.height
. How can i get the resolution of the screen in iOS?
Your answer
Follow this Question
Related Questions
iOS development: what hardware for testing? 1 Answer
Possible to render a simple colored spot rather than use a PNG? 0 Answers
is unity required iphone device ? 1 Answer
How do I read XML on iOS? 2 Answers