将如下脚本挂载到摄像机上即可
using UnityEngine; using System.Collections; public class CameraFull : MonoBehaviour { public Camera[] myCameraS; public float widthF = 480f; public float heightF = 800f; // Use this for initialization void Start() { foreach (Camera myCamera in myCameraS) { if (myCamera != null) myCamera.aspect = widthF / heightF; } } }
时间: 2024-09-29 23:33:12