iam porting may Game to iphone5 , and for that i have created a method to detect is device is iphone5 or not.
static function IsIphone5 ():boolean {
var rtn:boolean = false;
var mPlatform = Application.platform;
if (mPlatform == RuntimePlatform.IPhonePlayer) {
Debug.Log("IPhone Player Detected");
Debug.Log("IPhone Player Screen.height = "+Screen.height);
Debug.Log("IPhone Player Screen.width = "+Screen.width);
if ((Screen.width == 640 Screen.height == 1136) ||(Screen.width == 1136 Screen.height == 640)) {
// iPhone5
Debug.Log(" yes IPhone5 Detected");
rtn = true;
}
else {
rtn = false;
}
}
return rtn;
}
but on my device iPhone 5 still i am getting Screensize width = 640 and height = 960.which are for iphone 4,4s.
the same kind of device detection (Based on HeightxWidth) are working fine for other Devices(iPad,ipad3).
my development environment
Unity version 3.5.6
Xcode 4.5
deployment target ios5.0
Base SDK ios 6.0
what would be problem ? why iam getting screen height = 960
or any help ??? how can i detect at run time that device is iPhone5
any help is highly appreciated…