Unity3D鼠标点击处


if (Input.GetMouseButton(1)){//鼠标右键点击
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);//发射红外线
RaycastHit hit; //定义信息获取器
if (Physics.Raycast(ray, out hit)) {
hitPoint = hit.point;//获得鼠标点击处
}

posted on 2016-10-19 13:33  3137102247  阅读(169)  评论(0编辑  收藏  举报

导航