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;
        
    }
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-03
  • 2022-12-23
  • 2021-04-30
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
  • 2021-09-29
  • 2021-06-03
  • 2021-12-19
  • 2021-04-17
相关资源
相似解决方案