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;

posted on 2016-10-21 14:04  jiahuafu  阅读(682)  评论(0编辑  收藏  举报

导航