public class PixelPerfectCamera : MonoBehaviour {
public static float pixelsToUnits = 1f;
public static float scale = 1f;
public Vector2 nativeResolution = new Vector2(320, 160);
var camera = GetComponent<Camera>();
scale = Screen.height / nativeResolution.y;
camera.orthographicSize = (Screen.height / 2.0f) / pixelsToUnits;