thanks for reply.
we are not just replace the 'magnitude', of couse we have to modify relative codes to make the logic right.
Vector3.sqrMagnitude : Returns the squared length of this vector
If you just want to check the distance is bigger or smaller than a constant value, not to get a real distance , you really really should use sqrMagnitude instead of magnitude for the performance issue.
The reason for using sqrMagnitude instead of magnitude is because magnitude has to do a square root operation, which is pretty expensive, much more so than a multiplication.
example :
UICamera.cs : void ProcessTouch( ... )
...
float mag = currentTouch.totalDelta.magnitude;
...
if ( currentTouch.delta.magnitude != 0f )
...
example :
LookAtTarget.cs : LateUpdate() :
...
float mag = dir.magnitude ;
if(mag > 0.001f )
...
change to currentTouch.delta.sqrMagnitude is not better ? of course the sqrMagnitude is better than magnitude.
other examples in
UIDragObject.cs, UIWidget.cs, UIScrollView.cs