Learn / Documentation / Script Reference / OrientationDetector
Manual

OrientationDetector

class in Doozy.Engine.Orientation / Inherits from: MonoBehaviour

Description

The OrientationDetector is responsible for detecting the current screen orientation of the target device
See Also: TouchDetector

Static Properties

  •  public static OrientationDetector Instance – Returns a reference to the OrientationDetector in the Scene. If one does not exist, it gets created

  •  public static bool ApplicationIsQuitting – Internal variable used as a flag when the application is quitting

Properties

Public Variables

  •  public bool DebugMode – Enables relevant debug messages to be printed to the console

  •  public OrientationEvent OnOrientationEvent – Callback executed every time the device orientation changes that sends the new DetectedOrientation

Public Methods

  • public void CheckDeviceOrientation(bool forceUpdate = false) – Checks the current orientation and updates it if it changed. This method is called automatically by the OrientationDetector.

  • public void ChangeOrientation(DetectedOrientation newOrientation, bool forceUpdate = false) – Updates the current orientation to the given newOrientation and invokes OnOrientationEvent