magnitude是精确距离,sqrMagnitude是节省CPU的粗略距离,精度有损失

CubeA坐标 x:0 y:0.844 z:0

CubeC坐标 x:0 y:0 z:0

Vector3 aaa = A.position - C.position;

Debug.DrawLine(A.position, C.position, Color.green);

Debug.Log("aaa: " + aaa.ToString() + " magnitude:" + aaa.magnitude + " sqrMagnitude:" + aaa.sqrMagnitude);

magnitude是精确距离,sqrMagnitude是节省CPU的粗略距离,精度有损失-LMLPHP

05-02 21:43