Orientation Issue

I am having a subtle, but still unsettling orientation issue on the iPad.

I am creating an app that supports Portrait and UpsidedownPortait. If the app starts in the upside down orientation, but the iPad is horizontal, then the Unity splash screen displays in the correct orientation however the app does not. (if the app is upside down and vertical everything is fine)

I am controlling the orientation from inside my app with this snippet used in the Update method of a script:

if ((Input.deviceOrientation == DeviceOrientation.Portrait) 
           && (iPhoneSettings.screenOrientation !=
                  iPhoneScreenOrientation.Portrait))
 {    
        iPhoneSettings.screenOrientation = iPhoneScreenOrientation.Portrait;
 }
else if ((Input.deviceOrientation == DeviceOrientation.PortraitUpsideDown) 
         && (iPhoneSettings.screenOrientation != 
                  iPhoneScreenOrientation.PortraitUpsideDown))
 { 
        iPhoneSettings.screenOrientation = iPhoneScreenOrientation.PortraitUpsideDown;
 }

Any ideas?

Is there anyway I can tell the engine to change orientations, since the UIDevice is getting the orientation correctly?

Hi,

the answer is here:

http://www.fugutalk.com/?p=3365

in xCode, in Info.plist , add an array key UISupportedInterfaceOrientations and list all the supported orientations. Remove the one you don't want from the xml below.

<key>UISupportedInterfaceOrientations</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationPortraitUpsideDown</string>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>

tested and working on iPad.

Bye,

Jean