日期:2014-05-16 浏览次数:20314 次
function Update () { if (Input.GetMouseButton (0)) { var ray = Camera.main.ScreenPointToRay (Input.mousePosition); var hit : RaycastHit; if (Physics.Raycast (ray, hit)) { Debug.DrawLine (ray.origin, hit.point); print(hit.collider.gameObject.name); } } }