using UnityEngine;
using System.Collections;
public class Lu : MonoBehaviour{
public Camera cam;
// We need to actually hit an object
RaycastHit hitt = new RaycastHit();
// Use this for initialization
void Start() {
}
// Update is called once per frame
void Update() {
Ray ray = cam.ScreenPointToRay(Input.mousePosition);
Physics.Raycast(ray, out hitt, 100);
// Debug.DrawLine(cam.transform.position, ray.direction,Color.red);
if (null != hitt.transform) {
print(hitt.point);
//鼠标点击的坐标
}
}
}
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。