• 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;

  • 相关阅读:
    线程
    开启程序子进程的方式
    multiprocess模块
    计算机网络小知识
    解决粘包问题
    网络编程相关
    反射与元类
    多态相关
    封装相关与接口
    类的继承和组合
  • 原文地址:https://www.cnblogs.com/jiahuafu/p/5984406.html
Copyright © 2020-2023  润新知