File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
com.unity.netcode.gameobjects
Tests/Runtime/NetworkTransform Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -300,10 +300,18 @@ public void NetworkUpdate(NetworkUpdateStage updateStage)
300300
301301 DeferredMessageManager . ProcessTriggers ( IDeferredNetworkMessageManager . TriggerType . OnNextFrame , 0 ) ;
302302
303+ #if COM_UNITY_MODULES_PHYSICS
304+ NetworkTimeSystem . UpdateTime ( ) ;
305+
306+ // Transport processes events after time has been updated
307+ NetworkConfig . NetworkTransport . PreUpdate ( ) ;
308+ #endif
309+
303310 AnticipationSystem . SetupForUpdate ( ) ;
304311 MessageManager . ProcessIncomingMessageQueue ( ) ;
305312 MessageManager . CleanupDisconnectedClients ( ) ;
306313 AnticipationSystem . ProcessReanticipation ( ) ;
314+
307315 }
308316 break ;
309317#if COM_UNITY_MODULES_PHYSICS
@@ -331,10 +339,14 @@ public void NetworkUpdate(NetworkUpdateStage updateStage)
331339#endif
332340 case NetworkUpdateStage . PreUpdate :
333341 {
342+ #if ! COM_UNITY_MODULES_PHYSICS
334343 NetworkTimeSystem . UpdateTime ( ) ;
335344 AnticipationSystem . Update ( ) ;
336345 // Transport processes events after time has been updated
337346 NetworkConfig . NetworkTransport . PreUpdate ( ) ;
347+ #else
348+ AnticipationSystem . Update ( ) ;
349+ #endif
338350 }
339351 break ;
340352 case NetworkUpdateStage . PreLateUpdate :
Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ protected override void OnServerAndClientsCreated()
4646 rigidBody . maxLinearVelocity = 0 ;
4747 rigidBody . mass = 0 ;
4848 rigidBody . detectCollisions = false ;
49+ rigidBody . position = Vector3 . zero ;
50+ rigidBody . rotation = Quaternion . identity ;
51+ rigidBody . transform . position = Vector3 . zero ;
52+ rigidBody . transform . rotation = Quaternion . identity ;
4953 // NOTE: We don't use a sphere collider for this integration test because by the time we can
5054 // assure they don't collide and skew the results the NetworkObjects are already synchronized
5155 // with skewed results
@@ -60,6 +64,10 @@ protected override void OnServerAndClientsCreated()
6064 rigidBody . interpolation = RigidbodyInterpolation . None ;
6165 rigidBody . maxLinearVelocity = 0 ;
6266 rigidBody . detectCollisions = false ;
67+ rigidBody . position = Vector3 . zero ;
68+ rigidBody . rotation = Quaternion . identity ;
69+ rigidBody . transform . position = Vector3 . zero ;
70+ rigidBody . transform . rotation = Quaternion . identity ;
6371 // NOTE: We don't use a sphere collider for this integration test because by the time we can
6472 // assure they don't collide and skew the results the NetworkObjects are already synchronized
6573 // with skewed results
You can’t perform that action at this time.
0 commit comments