Detect Device Orientation Event

So I am working on creating an Input/Device event system and I am trying to check the device’s orientation through an event.

I can check the device orientation by using

if (Input.deviceOrientation == DeviceOrientation.Portrait)

in the update loop

However this causes all methods subscribed to the event to be called per frame and that is something I do not want to do. Is there a “cleaner” way to check if the device’s orientation has changed without using the update loop?

Did you already solved your issue?

Maybe in a OnRectTransformDimensionsChange()?

https://answers.unity.com/questions/1589034/how-can-i-detect-device-orientation-change-in-a-fa.html

If you could share if you succeeded and share it would be awesome!