相机分辨率设置

public class CameraSet : MonoBehaviour
{
    public float Width = 1280.0f;
    public float Height = 720.0f;
   
    void Update()
    {
        if(Screen.width/Screen.height > Width / Height)
        {
            Camera.current.orthographicSize = Height / Screen.height;
        }
        else
        {
            Camera.current.orthographicSize = Width / Screen.width;
        }
    }
}

最后更新于