I’ve added code to my iPad app in function Update() to check what the input orientation is and change the iPhoneSettings so that the screen is in the correct position by using the following code:
if ((iPhoneInput.orientation == iPhoneOrientation.LandscapeLeft) (iPhoneSettings.screenOrientation != iPhoneScreenOrientation.LandscapeLeft)){
iPhoneSettings.screenOrientation = iPhoneScreenOrientation.LandscapeLeft;
}
if ((iPhoneInput.orientation == iPhoneOrientation.LandscapeRight) (iPhoneSettings.screenOrientation != iPhoneScreenOrientation.LandscapeRight)){
iPhoneSettings.screenOrientation = iPhoneScreenOrientation.LandscapeRight;
}
But when I move the iPad around, the iPhoneInput.orientation always stays in LandscapeLeft, I can never get the orientation to change to LandscapeRight no matter how much I move around the iPad. The accelerometer works. Is there something I need to do in Unity to turn on the iPhoneInput.orientation function?