This is a paid asset, but now you can download Camera Fit: Screen Handler for FREE, Please keep in mind this package is provided only for learning purposes or to be able to test before buying the product, NOT FOR COMMERCIAL PURPOSES.
For more detail this asset from the Unity Asset Store: Click Here
Camera Fit Screen Handler v1.1
“If possible, please buy the package to support the developer”
Works with Unity 4.6, 5, 2017, 2018 and above.
Camera Fit is the easy way to handle screen aspect ratio for different devices, screens and window sizes!
Works on Mobile devices and all other platforms.
Supports both, orthographic (2D) and perspective (3D) cameras.
Has three different modes:
– Fixed height (pillarboxed) – Unity default.
– Fixed width (letterboxed).
– Dynamic (pillarboxed/letterboxed, depending on screen aspect ratio).
With the Dynamic mode, a specified area (main game area) will always be visible, no matter what screen/window size you choose – the Camera Fit component will adjust the frustum to always keep that area on-screen.
The Dynamic mode also lets you snap the main game area to the edges of the screen vertically/horizontally or always keep it in the middle.
Ask questions or discuss the plugin here.