I have a game what I made in 480x320 resolution (I have set it in the build settings) in Unity. But I would like to publish my game for every Android device with every resolutio
I assume it's 2D instead of 3D, this what I do:
And add this snippet on main Canvas' Awake method:
var canvasScaler = GetComponent();
var ratio = Screen.height / (float) Screen.width;
var rr = canvasScaler.referenceResolution;
canvasScaler.matchWidthOrHeight = (ratio < rr.x / rr.y) ? 1 : 0;
For 3D objects you can use any of the answers above