获取相机位置1.pubilc Transform trans
Debug.Log(trans.position)
2. Debug.Log(transform.position)
再获取物体位置 public GameObject player
获取俩物体的距离差
private Vector3 offset
Vector3 offset(需要在代码最前面先定义) = transform.position - player.transform.position
再定义相机的距离
transform.position = player.transform.position + offset