static void Screen_orientation(JSVCall vc) { if (vc.bGet) { var result = UnityEngine.Screen.orientation; JSApi.setEnum((int)JSApi.SetType.Rval, (int)result); } else { UnityEngine.ScreenOrientation arg0 = (UnityEngine.ScreenOrientation)JSApi.getEnum((int)JSApi.GetType.Arg); UnityEngine.Screen.orientation = arg0; } }
/* * Private. */ private void CheckOrientation() { if (CheckDeviceOrientationValid(Input.deviceOrientation) && _deviceOrientation != Input.deviceOrientation) { Log.Debug(o => $"CheckOrientation: for Device {o}", Input.deviceOrientation); _deviceOrientation = Input.deviceOrientation; DeviceOrientation = ToDeviceOrientation(Input.deviceOrientation); EventMap.Dispatch(OrientationEvent.DeviceOrientationChanged, DeviceOrientation); } if (_screenOrientation != Screen.orientation) { Log.Debug(o => $"CheckOrientation: for Screen {o}", Screen.orientation); _screenOrientation = Screen.orientation; ScreenOrientation = ToScreenOrientation(_screenOrientation); EventMap.Dispatch(OrientationEvent.ScreenOrientationChanged, ScreenOrientation); } }
public static void CacheSurfaceOrientation(UnityEngine.ScreenOrientation surfaceOrientation) { sScreenOrientation = surfaceOrientation; }