I’m integrating a unity view as part of a larger iOS application.
In this larger iOS application the unity view acts somewhat like a video player (doing a lot more than just video textures, but that’s unrelated to issue), starting out at 16:9 aspect ratio and just a subset of the full screen then allowing the user to go fullscreen as well.
Our problem is controlling the orientation. Orientation is getting changed every time the view is resized. We tracked it down to UnityReportResizeView that gets called in UI/UnityView.mm:
_curOrientation = (ScreenOrientation)UnityReportResizeView(renderSize.width, renderSize.height, self.contentOrientation);
I’m not sure what UnityReportResizeView is doing exactly, but it seem to take into account width and height when setting the orientation. For example, if the phone is in portrait, but the viewport’s width is longer than it’s height (say non-fullscreen mode, a 16:9 viewport at top of screen) the orientation of the view will be sideways.
Could someone illuminate what’s going on under the hood in UnityReportResizeView?