- Home /
UnityAppController's didRotateFromInterfaceOrientation not getting called on rotating device
So am working on sending messages from Xcode to Unity scripts. In my case I wanted to send message when device changes its interface orientation. Just to check proof of concept, I create a basic scene in Unity3D, build and make a IOS project. Open the project in Xcode, open the UnityAppController.mm and add the following function in its AppController section
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
[super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
NSLog(@"Did Rotate");
}
When I run this on a simulator and rotate the device using simulator options I don't see the "Did Rotate" message.
If I make a native IOS app and have the same function in its ViewController.mm it does print the statement.
Could anyone please let me know why the function is not getting called when we make an IOS project from Unity 3D. What am i missing here ?
Comment