鼠标坐标转世界坐标和局部坐标: Vector3 MousePosition2Local () { mousePosition = Input.mousePosition; //获取屏幕坐标 mouseWorldPos = Camera.main.ScreenToWorldPoint (mousePosition); //屏幕坐标转世界坐标 mouseLocalPos = transform.parent.transform.InverseTransformPoint (mouseWorldPos); //世界坐标转本地坐标 return CorrectPos(mouseLocalPos); }