@@ -130,7 +130,7 @@ private int m_GroundedParameterId;
130130private bool m_WasGrounded ;
131131private Animator m_Animator ;
132132private CharacterController m_CharacterController ;
133-
133+
134134protected override void OnNetworkPreSpawn (ref NetworkManager networkManager )
135135{
136136 // Pre-calculate the hash for quick lookup.
@@ -168,7 +168,7 @@ private bool m_WasGrounded;
168168private Animator m_Animator ;
169169private NetworkAnimator m_NetworkAnimator ;
170170private CharacterController m_CharacterController ;
171-
171+
172172protected override void OnNetworkPreSpawn (ref NetworkManager networkManager )
173173{
174174 // Pre-calculate the hash values for performance purposes.
@@ -269,7 +269,7 @@ protected override void OnNetworkPostSpawn()
269269 // Register the authority for both the Update and PostLateUpdate player loop stages
270270 // Update used to handle input and apply motion.
271271 NetworkUpdateLoop .RegisterNetworkUpdate (this , NetworkUpdateStage .Update );
272-
272+
273273 // PostLateUpdate handles camera rotation adjustments
274274 NetworkUpdateLoop .RegisterNetworkUpdate (this , NetworkUpdateStage .PostLateUpdate );
275275 _input .enabled = true ;
@@ -299,7 +299,7 @@ public override void OnNetworkPreDespawn()
299299 base .OnNetworkPreDespawn ();
300300}
301301
302- // This class implements INetworkUpdateSystem
302+ // This class implements INetworkUpdateSystem
303303public void NetworkUpdate (NetworkUpdateStage updateStage )
304304{
305305 if (! IsSpawned )
@@ -325,7 +325,7 @@ public void NetworkUpdate(NetworkUpdateStage updateStage)
325325 }
326326 else if (m_WasMoving )
327327 {
328- // If synchronizing speed and we were moving, then
328+ // If synchronizing speed and we were moving, then
329329 // reset the fields used to calculate speed
330330 m_WasMoving = false ;
331331 m_UnitsPerSecond = 0 . 0 f ;
@@ -349,8 +349,8 @@ private void NonAuthorityUpdate()
349349 var deltaVector3 = transform .position - m_LastPosition ;
350350 // An approximated calculation of the potential unity world space units per second by getting the quotient of delta time divided into 1. We are only interested in x and z deltas, so use a Vector2, and then obtain the magnitude of the quotient times the Vector2.
351351 var unitsPerSecond = (new Vector2 (deltaVector3 .x , deltaVector3 .z ) * (1 . 0 f / Time .deltaTime )).magnitude ;
352-
353- // Only trigger when the delta per frame exceeds the non-authority motion threshold
352+
353+ // Only trigger when the delta per frame exceeds the non-authority motion threshold
354354 if (unitsPerSecond > m_NonAuthorityMotionThreshold )
355355 {
356356 // if the new delta is > or < the last value stored
@@ -364,7 +364,7 @@ private void NonAuthorityUpdate()
364364
365365 // round speed to 3 decimal places like it does with player input
366366 _speed = (float )System .Math .Round (m_UnitsPerSecond , 3 );
367-
367+
368368 // Track that we are now moving
369369 m_WasMoving = true ;
370370 }
@@ -389,7 +389,7 @@ private void NonAuthorityUpdate()
389389 }
390390 // Apply the calculated speed value
391391 _animator .SetFloat (_animIDSpeed , _speed );
392-
392+
393393 }
394394 else if (m_WasMoving )
395395 {
0 commit comments