unity camera fit
public float horizontalFoV = 90.0f;
// for perspective cam
void Update() {
float halfWidth = Mathf.Tan(0.5f * horizontalFoV * Mathf.Deg2Rad);
float halfHeight = halfWidth * Screen.height / Screen.width;
float verticalFoV = 2.0f * Mathf.Atan(halfHeight) * Mathf.Rad2Deg;
camera.fieldOfView = verticalFoV;
}