Hello!
I would like to have smooth rotation of unity window, using stadard iOS fetures.
Here is what I did:
-
create class inherited from UIViewController and override
(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation -
in method
int OpenEAGL_UnityCallback(UIWindow** window, int* screenWidth, int* screenHeight, int* openglesVersion)
replace first lines of code with
// Create a full-screen window
_window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 480, 320)];
EAGLView* view = [[EAGLView alloc] initWithFrame:CGRectMake(0, 0, 480, 320)];
RotationViewController * rotationCtrl = [[RotationViewController alloc] init];
[_window addSubview:rotationCtrl.view];
[rotationCtrl.view addSubview:view];
I got incorrect behaviour on device⦠Rotation is smoothed - but with bugs (view did not correspond to expected)
Question:
- what should be done inside unity code?
(now i am doing following in FixedUpdate()
if (iPhoneInput.orientation == iPhoneOrientation.LandscapeLeft
iPhoneSettings.screenOrientation != iPhoneScreenOrientation.LandscapeLeft)
{
iPhoneSettings.screenOrientation = iPhoneScreenOrientation.LandscapeLeft;
}
else if (iPhoneInput.orientation == iPhoneOrientation.LandscapeRight
iPhoneSettings.screenOrientation != iPhoneScreenOrientation.LandscapeRight)
{
iPhoneSettings.screenOrientation = iPhoneScreenOrientation.LandscapeRight;
}
)
- what should be done in xCode?
Thanks!
I think unity developers should add such behavioud as DEFAULT in the xCode project
- the smooth rotaion is very nice feature - donot skip it

Regards,
Alex