Vector3 *2 ,ToString()自动四舍五入
还以为出错了,仔细看发现ToString()自动四舍五入
Vector3 forward = Camera.main.transform.forward;
Debug.Log("forward:" + forward.x.ToString() + "," +
forward.y.ToString() + "," +
forward.z.ToString() +
" forward * 2:" + (forward * 2).x.ToString() + "," +
(forward * 2).y.ToString() + "," +
(forward * 2).z.ToString()
);
gameObject.transform.position = Camera.main.transform.position +
forward * 2;