获取鼠标点击的屏幕坐标

作者:追风剑情 发布于:2014-4-17 11:27 分类:Unity3d

  1. void Update () {
  2. if (Input.GetMouseButtonDown(0))
  3. {
  4. Vector3 screenPos = Input.mousePosition;
  5. Debug.Log("screenPos.x=" + screenPos.x + ", screenPos.y=" + screenPos.y + ", screenPos.z=" + screenPos.z);
  6. }
  7. }

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号