This has the same functionality as Screen.autorotateToPortrait and also mimics platform-specific behavior in the Unity Editor.