How to handle runtime device rotations

I am looking for an approach or possibly an asset that can automatically handle the situation of Unity running on a device, and that device being rotated. Now I realize that I can test for the device orientation using something like this, but this isn’t my question:

if ( Input.deviceOrientation == DeviceOrientation.LandscapeLeft )

What I am really after is a way to create a UI based on a portrait or landscape orientation and have it automatically move when a orientation is detected so that I can support multiple resolutions and orientations for my game.

Is there a feature in Unity that can automatically handle resolution and orientations or an asset that I can use for my canvas? If not, I’ll write an asset to do it.

Using the Unity UI, by properly applying the concept of anchor points, it shouldn’t matter if your game is in portrait or landscape mode, as it should be able to handle any and all resolutions.

Make sure to read through this

Landscape and portrait are just different resolutions. Nothing special. Using the code snippet you showed, you could do specific behaviour for either orientation if you want in scripts.