@@ -20,7 +20,7 @@ public void MoveRpc(Vector3 newPosition)
2020 {
2121 transform . position = newPosition ;
2222 }
23-
23+
2424 [ Rpc ( SendTo . Server ) ]
2525 public void LocalMoveRpc ( Vector3 newPosition )
2626 {
@@ -106,8 +106,7 @@ protected override void OnTimeTravelServerAndClientsConnected()
106106 otherClientComponent . transform . position = Vector3 . zero ;
107107 otherClientComponent . transform . localScale = Vector3 . one ;
108108 otherClientComponent . transform . rotation = Quaternion . LookRotation ( Vector3 . forward ) ;
109-
110-
109+
111110 var childObject = SpawnObject ( m_TestPrefab , m_ServerNetworkManager ) ;
112111 childObject . transform . parent = serverComponent . transform ;
113112 childObject . transform . localPosition = Vector3 . zero ;
@@ -174,7 +173,7 @@ public void WhenAnticipating_ValueChangesImmediately()
174173 testComponent . AnticipateMove ( new Vector3 ( 0 , 1 , 2 ) ) ;
175174 testComponent . AnticipateScale ( new Vector3 ( 1 , 2 , 3 ) ) ;
176175 testComponent . AnticipateRotate ( Quaternion . LookRotation ( new Vector3 ( 2 , 3 , 4 ) ) ) ;
177-
176+
178177 childComponent . AnticipateMove ( new Vector3 ( 0 , 1 , 2 ) ) ;
179178 childComponent . AnticipateScale ( new Vector3 ( 1 , 2 , 3 ) ) ;
180179 childComponent . AnticipateRotate ( Quaternion . LookRotation ( new Vector3 ( 2 , 3 , 4 ) ) ) ;
@@ -186,8 +185,7 @@ public void WhenAnticipating_ValueChangesImmediately()
186185 Assert . AreEqual ( new Vector3 ( 0 , 1 , 2 ) , testComponent . AnticipatedState . Position ) ;
187186 Assert . AreEqual ( new Vector3 ( 1 , 2 , 3 ) , testComponent . AnticipatedState . Scale ) ;
188187 Assert . That ( testComponent . AnticipatedState . Rotation , Is . EqualTo ( Quaternion . LookRotation ( new Vector3 ( 2 , 3 , 4 ) ) ) . Using ( quaternionComparer ) ) ; // Quaternion comparer added due to FP precision problems on Android devices.
189-
190-
188+
191189 Assert . AreEqual ( new Vector3 ( 0 , 1 , 2 ) , childComponent . transform . localPosition ) ;
192190 Assert . AreEqual ( new Vector3 ( 1 , 2 , 3 ) , childComponent . transform . localScale ) ;
193191 Assert . That ( childComponent . transform . localRotation , Is . EqualTo ( Quaternion . LookRotation ( new Vector3 ( 2 , 3 , 4 ) ) ) . Using ( quaternionComparer ) ) ; // Quaternion comparer added due to FP precision problems on Android devices.
@@ -206,23 +204,23 @@ public void WhenAnticipating_AuthoritativeValueDoesNotChange()
206204 var startPosition = testComponent . transform . position ;
207205 var startScale = testComponent . transform . localScale ;
208206 var startRotation = testComponent . transform . rotation ;
209-
207+
210208 var childStartPosition = childComponent . transform . localPosition ;
211209 var childStartScale = childComponent . transform . localScale ;
212210 var childStartRotation = childComponent . transform . localRotation ;
213211
214212 testComponent . AnticipateMove ( new Vector3 ( 0 , 1 , 2 ) ) ;
215213 testComponent . AnticipateScale ( new Vector3 ( 1 , 2 , 3 ) ) ;
216214 testComponent . AnticipateRotate ( Quaternion . LookRotation ( new Vector3 ( 2 , 3 , 4 ) ) ) ;
217-
215+
218216 childComponent . AnticipateMove ( new Vector3 ( 0 , 1 , 2 ) ) ;
219217 childComponent . AnticipateScale ( new Vector3 ( 1 , 2 , 3 ) ) ;
220218 childComponent . AnticipateRotate ( Quaternion . LookRotation ( new Vector3 ( 2 , 3 , 4 ) ) ) ;
221219
222220 Assert . AreEqual ( startPosition , testComponent . AuthoritativeState . Position ) ;
223221 Assert . AreEqual ( startScale , testComponent . AuthoritativeState . Scale ) ;
224222 Assert . AreEqual ( startRotation , testComponent . AuthoritativeState . Rotation ) ;
225-
223+
226224 Assert . AreEqual ( childStartPosition , childComponent . AuthoritativeState . Position ) ;
227225 Assert . AreEqual ( childStartScale , childComponent . AuthoritativeState . Scale ) ;
228226 Assert . AreEqual ( childStartRotation , childComponent . AuthoritativeState . Rotation ) ;
@@ -237,7 +235,7 @@ public void WhenAnticipating_ServerDoesNotChange()
237235 var startPosition = testComponent . transform . position ;
238236 var startScale = testComponent . transform . localScale ;
239237 var startRotation = testComponent . transform . rotation ;
240-
238+
241239 var childStartPosition = childComponent . transform . localPosition ;
242240 var childStartScale = childComponent . transform . localScale ;
243241 var childStartRotation = childComponent . transform . localRotation ;
@@ -249,7 +247,7 @@ public void WhenAnticipating_ServerDoesNotChange()
249247 childComponent . AnticipateMove ( new Vector3 ( 0 , 1 , 2 ) ) ;
250248 childComponent . AnticipateScale ( new Vector3 ( 1 , 2 , 3 ) ) ;
251249 childComponent . AnticipateRotate ( Quaternion . LookRotation ( new Vector3 ( 2 , 3 , 4 ) ) ) ;
252-
250+
253251 var serverComponent = GetServerComponent ( ) ;
254252 var serverChild = GetChildComponent ( serverComponent ) ;
255253
@@ -293,7 +291,7 @@ public void WhenAnticipating_OtherClientDoesNotChange()
293291 var startPosition = testComponent . transform . position ;
294292 var startScale = testComponent . transform . localScale ;
295293 var startRotation = testComponent . transform . rotation ;
296-
294+
297295 var childStartPosition = childComponent . transform . localPosition ;
298296 var childStartScale = childComponent . transform . localScale ;
299297 var childStartRotation = childComponent . transform . localRotation ;
@@ -349,7 +347,7 @@ public void WhenServerChangesSnapValue_ValuesAreUpdated()
349347 testComponent . AnticipateMove ( new Vector3 ( 0 , 1 , 2 ) ) ;
350348 testComponent . AnticipateScale ( new Vector3 ( 1 , 2 , 3 ) ) ;
351349 testComponent . AnticipateRotate ( Quaternion . LookRotation ( new Vector3 ( 2 , 3 , 4 ) ) ) ;
352-
350+
353351 testChild . AnticipateMove ( new Vector3 ( 0 , 1 , 2 ) ) ;
354352 testChild . AnticipateScale ( new Vector3 ( 1 , 2 , 3 ) ) ;
355353 testChild . AnticipateRotate ( Quaternion . LookRotation ( new Vector3 ( 2 , 3 , 4 ) ) ) ;
@@ -376,7 +374,7 @@ public void WhenServerChangesSnapValue_ValuesAreUpdated()
376374 Assert . AreEqual ( serverComponent . transform . position , otherClientComponent . transform . position ) ;
377375 Assert . AreEqual ( serverComponent . transform . position , otherClientComponent . AnticipatedState . Position ) ;
378376 Assert . AreEqual ( serverComponent . transform . position , otherClientComponent . AuthoritativeState . Position ) ;
379-
377+
380378 Assert . AreEqual ( serverChild . transform . localPosition , testChild . transform . localPosition ) ;
381379 Assert . AreNotEqual ( serverChild . transform . localPosition , testChild . transform . position ) ;
382380 Assert . AreEqual ( serverChild . transform . localPosition , testChild . AnticipatedState . Position ) ;
0 commit comments