File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -149,15 +149,18 @@ public IEnumerator NetworkedMessagesAreStillReceivedAfterNetworkManagerShutsDown
149
149
150
150
m_NbMessagesReceived = 0 ;
151
151
152
+ m_PlayerPrefab . SetActive ( false ) ; // to prevent NM from destroying the prefab on shutdown. This flow isn't great and is hackish, should be reworked
152
153
// Shutdown the server and clients
153
- NetcodeIntegrationTestHelpers . StopOneClient ( m_ServerNetworkManager , false ) ;
154
- NetcodeIntegrationTestHelpers . StopOneClient ( m_ClientNetworkManagers [ 0 ] , false ) ;
155
- NetcodeIntegrationTestHelpers . StopOneClient ( m_ClientNetworkManagers [ 1 ] , false ) ;
154
+ m_ServerNetworkManager . Shutdown ( ) ;
155
+ m_ClientNetworkManagers [ 0 ] . Shutdown ( ) ;
156
+ m_ClientNetworkManagers [ 1 ] . Shutdown ( ) ;
156
157
157
158
yield return new WaitWhile ( ( ) => m_ServerNetworkManager . ShutdownInProgress ) ;
158
159
yield return new WaitWhile ( ( ) => m_ClientNetworkManagers [ 0 ] . ShutdownInProgress ) ;
159
160
yield return new WaitWhile ( ( ) => m_ClientNetworkManagers [ 1 ] . ShutdownInProgress ) ;
160
161
162
+ m_PlayerPrefab . SetActive ( true ) ; // reactivating after destroy prevention
163
+
161
164
// Restart the server and clients
162
165
m_ServerNetworkManager . StartHost ( ) ;
163
166
NetcodeIntegrationTestHelpers . StartOneClient ( m_ClientNetworkManagers [ 0 ] ) ;
You can’t perform that action at this time.
0 commit comments