I’m new to Unity, and I’m stuck on something. My Android app doesn’t rotate when invoked from a Unity player screen.
Is there no way to listen to screen orientation changes other than:
void Update()
{
if (Input.deviceOrientation == DeviceOrientation.LandscapeLeft) {
_myUnityPlugin.CallStatic("onOrientationChanged", "landscape");
}
else if (Input.deviceOrientation == DeviceOrientation.Portrait) {
_myUnityPlugin.CallStatic("onOrientationChanged", "portrait");
}
}
My Unity player goes into OnApplicationPause when my Android api is invoked. So I can’t run the above orientation checks in Update() at that point, and the new activity that’s launched isn’t responding to orientation shifts.
Hope that makes sense.