Hi guys,
I have this really simple script for flipping the screen when it’s on the phone, but I was thinking there must be a better way to do it. Just seems a shame to have something that happens so infrequently running in an update script.
function Update(){// Keeps the screen in the right orientation
if (Input.deviceOrientation == DeviceOrientation.LandscapeLeft iPhoneSettings.screenOrientation != iPhoneScreenOrientation.LandscapeLeft){
iPhoneSettings.screenOrientation = iPhoneScreenOrientation.LandscapeLeft;
}
if (Input.deviceOrientation == DeviceOrientation.LandscapeRight iPhoneSettings.screenOrientation != iPhoneScreenOrientation.LandscapeRight){
iPhoneSettings.screenOrientation = iPhoneScreenOrientation.LandscapeRight;
}
if (iPhoneSettings.screenOrientation == iPhoneScreenOrientation.LandscapeLeft)ScreenOrientationState = 1;
if (iPhoneSettings.screenOrientation == iPhoneScreenOrientation.LandscapeRight)ScreenOrientationState = -1;
}
Or am I worrying about it too much?