/// <summary> /// Updates the currentOrientation to the specified value and sends an UnityEvent to signal the change. /// </summary> public void ChangeOrientation(Orientation newOrientation) { currentOrientation = newOrientation; onOrientationChange.Invoke(currentOrientation); if (debug) { D.Log("[OrientationManager] currentOrientation: " + currentOrientation.ToString()); } }
/// <summary> /// Updates the currentOrientation to the specified value and sends an UnityEvent to signal the change. /// </summary> public void ChangeOrientation(Orientation newOrientation, bool forceUpdate = false) { currentOrientation = newOrientation; onOrientationChange.Invoke(currentOrientation); deviceOrientationCheckCount++; if (deviceOrientationCheckCount > 2 || forceUpdate) { NotifyUIManager(newOrientation); } if (debug) { Debug.Log("[OrientationManager] currentOrientation: " + currentOrientation.ToString()); } }
/// <summary> /// Notifies the orientation change. /// </summary> /// <param name="orientation">Orientation.</param> public void NotifyOrientationChange(Orientation orientation) { Orientation = orientation; OrientationChange?.Invoke(this, orientation); }
public override void OnConfigurationChanged(Android.Content.Res.Configuration newConfig) { OnOrientationChange?.Invoke(newConfig.Orientation == Android.Content.Res.Orientation.Portrait ? "Portrait" : "Landscape"); base.OnConfigurationChanged(newConfig); }