public class CameraAuto : MonoBehaviour { float fDefaultRatio = 720.0f / 1280.0f;//预先设定屏幕大小1280*720 // Use this for initialization void Start () { float fRatio = (float)Screen.width / Screen.height; Camera.main.orthographicSize = Camera.main.orthographicSize* fRatio * fDefaultRatio; } }