/// <summary> Update the current orientation to the given newOrientation and invoke OnOrientationEvent </summary> public void ChangeOrientation(DetectedOrientation newOrientation, bool forceUpdate = false) { m_currentOrientation = newOrientation; OnOrientationEvent.Invoke(m_currentOrientation); Message.Send("DetectedOrientation." + newOrientation); m_deviceOrientationCheckCount++; if (m_deviceOrientationCheckCount > 2 || forceUpdate) { //NotifyUIManager(newOrientation); } if (DebugComponent) { DDebug.Log("Current device orientation: " + m_currentOrientation, this); } }
public void OnOrientationEvent(DetectedOrientation orientation) { this.GetComponent <TextMeshProUGUI>().text = orientation.ToString(); }