首页 > 代码库 > Unity摄像机适配

Unity摄像机适配

将如下脚本挂载到摄像机上即可

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

}


Unity摄像机适配