- 最后登录
- 2017-5-15
- 注册时间
- 2012-3-1
- 阅读权限
- 90
- 积分
- 32973
- 纳金币
- 32806
- 精华
- 12
|
public GameObject cameraObj;
void OnMouseDown()
{
Vector3 objVector3 = Camera.mainCamera.WorldToScreenPoint(this.cameraObj.transform.position);
Vector3 off = new Vector3(Input.mousePosition.x - objVector3.x, Input.mousePosition.y - objVector3.y, objVector3.z);
Vector3 mousePositon = new Vector3(off.x +off.x+ Input.mousePosition.x,off.y +off.y+ Input.mousePosition.y, off.z);
Vector3 posit = Camera.mainCamera.ScreenToWorldPoint(mousePositon);
cameraObj.transform.position = new Vector3(posit.x,0.7499999f,posit.z);
}
把脚本赋给地形, 点击移动有问题。 谁有好的方法,告诉我一下
|
|