Is is possible for my script to be notified at the moment the device changes orientation? I'd rather not keep testing for device orientation on each frame... Maybe there's something like the delegate protocols in Obj-C, but no amount of searching or looking through the docs has helped.
Any help much appreciated!
I figured it out using UnitySendMessage - in Xcode, in "AppController.mm", in -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation I added:
and in Unity, in the script on my Game Manager gameObject I added -
Being new to Unity I hadn't realised there could be 2-way communication between Unity & the Obj-c stuff. Probably elementary to most people here, but I thought I'd post it in case it helps someone avoid the troubles I had.