private Vector3 targetVector3;
private float movespeed=0.5f;
private bool IsOver = true;
private GameObject player;
private Camera firstCamera;
float sensitivityX = 2f;
public void Start (GameObject _player,Camera cam)
{
player = _player;
firstCamera = cam;
}
public void Update () {
if (Input.GetMouseButton(0))
{
if (firstCamera == null)
return;
//视角移动
firstCamera.transform.Rotate(0, Input.GetAxis("Mouse X") * sensitivityX, 0);
//1. 获取鼠标点击位置
//创建射线;从摄像机发射一条经过鼠标当前位置的射线
Ray ray = firstCamera.ScreenPointToRay(Input.mousePosition);
//发射射线
RaycastHit hitInfo = new RaycastHit();
if (Physics.Raycast(ray, out hitInfo))
{
//获取碰撞点的位置
if (hitInfo.collider.na