Class OrientationDetector
Detects the current screen orientation of the target device.
Inherited Members
Namespace: Doozy.Runtime.UIManager.Orientation
Assembly: cs.temp.dll.dll
Syntax
public class OrientationDetector : SingletonBehaviour<OrientationDetector>
Fields
OnAnyOrientation
Callback triggered when the device orientation changed
Declaration
public ModyEvent OnAnyOrientation
Field Value
Type | Description |
---|---|
ModyEvent |
OnLandscapeOrientation
Callback triggered when the device orientation changed to Landscape
Declaration
public ModyEvent OnLandscapeOrientation
Field Value
Type | Description |
---|---|
ModyEvent |
OnOrientationChanged
Callback triggered when the device orientation changed
Declaration
public DetectedOrientationEvent OnOrientationChanged
Field Value
Type | Description |
---|---|
DetectedOrientationEvent |
OnPortraitOrientation
Callback triggered when the device orientation changed to Portrait
Declaration
public ModyEvent OnPortraitOrientation
Field Value
Type | Description |
---|---|
ModyEvent |
Properties
canvas
Reference to the Canvas component
Declaration
public Canvas canvas { get; }
Property Value
Type | Description |
---|---|
Canvas |
currentOrientation
Current detected device orientation
Declaration
public DetectedOrientation currentOrientation { get; }
Property Value
Type | Description |
---|---|
DetectedOrientation |
previousScreenOrientation
Previous logical screen orientation (previous Screen.orientation value)
Declaration
public ScreenOrientation previousScreenOrientation { get; }
Property Value
Type | Description |
---|---|
ScreenOrientation |
rectTransform
Reference to the RectTransform component
Declaration
public RectTransform rectTransform { get; }
Property Value
Type | Description |
---|---|
RectTransform |
stream
Signal stream for the OrientationDetector
Declaration
public static SignalStream stream { get; }
Property Value
Type | Description |
---|---|
SignalStream |
Methods
Awake()
Declaration
protected override void Awake()
Overrides
CheckDeviceOrientation()
Check the current device orientation and send a signal with the orientation value if it has changed.
This method is called automatically by the OrientationDetector.
Declaration
public void CheckDeviceOrientation()
CheckDeviceOrientation(Boolean)
Check the current device orientation and send a signal with the orientation value if it has changed.
Declaration
public void CheckDeviceOrientation(bool forceUpdate)
Parameters
Type | Name | Description |
---|---|---|
Boolean | forceUpdate | Force the update of the orientation value, even if it hasn't changed (to trigger callbacks) |
Initialize()
Set the proper settings for the Canvas and RectTransform components
Declaration
public void Initialize()