I want to use Input .deviceOrientation
to detect the phone orientation change and do some action as I need. So I use below code:
void Update() {
if (Input.deviceOrientation == DeviceOrientation.LandscapeLeft) {
UseLandscapeLeftLayout();
}
else if (Input.deviceOrientation == DeviceOrientation.Portrait) {
UsePortraitLayout();
}
}
This works well in Android devices, However, when run in ios10 ( I didn’t check other ios versions), the Input.deviceOrientation value is always the same no matter what orientation I lay my phone.
Could you please help me on that? why
Unity: 5.3.4f1 + ios10