脚本挂在摄像机下
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//摄像机显示结果一致(拉伸)
public class CameraAdaptation : MonoBehaviour
{
public float initWidth;//正常宽
public float initHeight;//正常高
// Update is called once per frame
void Update()
{
this.GetComponent<Camera>().aspect = initWidth/ initHeight;
}
}