using UnityEngine;
using System.Collections;

[RequireComponent(typeof(Camera))]
public class LetterBoxing : MonoBehaviour 
{
	const float KEEP_ASPECT = 16f/9f;

	void Awake()
	{
		float aspectRatio = Screen.width / ((float)Screen.height);
		float percentage = 1 - (aspectRatio / KEEP_ASPECT);

		Camera.main.rect = new Rect(0f, (percentage / 2), 1f, (1 - percentage));
	}
}
