对于unity中的位移向量等基础跳过,直接上代码:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraControl : MonoBehaviour
{
// Start is called before the first frame update
public GameObject player;
private Vector3 temp;
private Vector3 temporg;
public float zoomspeed = 0.2f;//用于开始移动相机的缓冲时间
public float m_DampTime = 0.02f