获取点击坐标(脚本代码记录)

    RaycastHit hit;
    Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);

    if (Physics.Raycast(ray, out hit, 1000))
    {
        Vector3 posiont = new Vector3(hit.point.x, hit.point.y, hit.point.z);
        Debug.Log("点击位置:" + posiont);
    }

  

posted @ 2014-11-21 23:12  memaze  阅读(326)  评论(0)    收藏  举报