The distance is calculated:
float dist = (cam.rangeDistance > 0f) ? cam.rangeDistance : currentCamera.farClipPlane - currentCamera.nearClipPlane;
when camera is OrthoGraphic there was no problem,but in 3D camare,whether this should be changed?
float dist = 0;
if (cam.rangeDistance > 0f) dist = cam.rangeDistance;
else
{
dist = currentCamera.farClipPlane - currentCamera.nearClipPlane;
if (!currentCamera.isOrthoGraphic)
dist /= Mathf.Cos(Vector3.Angle(currentCamera.transform.forward, ray.direction) * 0.01745f);
}