// force renderer to show up always in portrait orientation protected override void OnWindowVisibilityChanged([GeneratedEnum] ViewStates visibility) { base.OnWindowVisibilityChanged(visibility); var activity = (Activity)Context; if (visibility.Equals(ViewStates.Gone)) { // go back to previous orientation activity.RequestedOrientation = _previousOrientation; } else if (visibility.Equals(ViewStates.Visible)) { if (_previousOrientation.Equals(ScreenOrientation.Sensor)) { _previousOrientation = activity.RequestedOrientation; } activity.RequestedOrientation = ScreenOrientation.Portrait; } }
/// <summary> /// /// </summary> /// <param name="obj"></param> /// <returns></returns> public override bool Equals(object obj) { var other = obj as ScreenKun; if (other == null) { return(false); } if (!m_currentResolutionWidth.Equals(other.m_currentResolutionWidth)) { return(false); } if (!m_currentResolutionHeight.Equals(other.m_currentResolutionHeight)) { return(false); } if (!m_currentResolutionRefreshRate.Equals(other.m_currentResolutionRefreshRate)) { return(false); } if (!m_width.Equals(other.m_width)) { return(false); } if (!m_height.Equals(other.m_height)) { return(false); } if (!m_sleepTimeout.Equals(other.m_sleepTimeout)) { return(false); } if (!m_preferredRefreshRate.Equals(other.m_preferredRefreshRate)) { return(false); } if (!m_autorotateToLandscapeLeft.Equals(other.m_autorotateToLandscapeLeft)) { return(false); } if (!m_autorotateToLandscapeRight.Equals(other.m_autorotateToLandscapeRight)) { return(false); } if (!m_autorotateToPortrait.Equals(other.m_autorotateToPortrait)) { return(false); } if (!m_autorotateToPortraitUpsideDown.Equals(other.m_autorotateToPortraitUpsideDown)) { return(false); } if (!m_fullScreen.Equals(other.m_fullScreen)) { return(false); } #if UNITY_2019_1_OR_NEWER if (!m_brightness.Equals(other.m_brightness)) { return(false); } #endif if (!m_dpi.Equals(other.m_dpi)) { return(false); } if (!m_fullScreenMode.Equals(other.m_fullScreenMode)) { return(false); } if (!m_orientation.Equals(other.m_orientation)) { return(false); } if (!RectKun.Equals(m_safeArea, other.m_safeArea)) { return(false); } #if UNITY_2019_1_OR_NEWER if (m_cutouts != null) { if (other.m_cutouts == null) { return(false); } if (m_cutouts.Length != other.m_cutouts.Length) { return(false); } for (var i = 0; i < m_cutouts.Length; i++) { if (!RectKun.Equals(m_cutouts[i], other.m_cutouts[i])) { return(false); } } } #endif if (m_resolutions != null) { if (other.m_resolutions == null) { return(false); } if (m_resolutions.Length != other.m_resolutions.Length) { return(false); } for (var i = 0; i < m_resolutions.Length; i++) { if (!ResolutionKun.Equals(m_resolutions[i], other.m_resolutions[i])) { return(false); } } } return(true); }
public bool Equals(XRCameraParams other) { return(m_ZNear.Equals(other.m_ZNear) && m_ZFar.Equals(other.m_ZFar) && m_ScreenWidth.Equals(other.m_ScreenWidth) && m_ScreenHeight.Equals(other.m_ScreenHeight) && m_ScreenOrientation.Equals(other.m_ScreenOrientation)); }