1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
using UnityEngine; public class CameraAdapt : MonoBehaviour { float defaultRatio = 1080.0f / 1920.0f; // Use this for initialization void Start() { float currentRatio = (float)Screen.width / Screen.height; //透视 Camera.main.fieldOfView = Camera.main.fieldOfView * defaultRatio / currentRatio; //正交 // Camera.main.orthographicSize = Camera.main.orthographicSize * defaultRatio / currentRatio; } } |
- 本文固定链接: http://www.u3d8.com/?p=2265
- 转载请注明: 网虫虫 在 u3d8.com 发表过