public void StopCurrentSession() { SceneManager.sceneLoaded -= SceneManager_sceneLoaded; multiplayerSession.Disconnect(); OnAfterMultiplayerEnd?.Invoke(); //Always do this last. NitroxServiceLocator.EndCurrentLifetimeScope(); }
public void StopCurrentSession() { SceneManager.sceneLoaded -= SceneManager_sceneLoaded; if (multiplayerSession.CurrentState.CurrentStage != MultiplayerSessionConnectionStage.DISCONNECTED) { multiplayerSession.Disconnect(); } OnAfterMultiplayerEnd?.Invoke(); //Always do this last. NitroxServiceLocator.EndCurrentLifetimeScope(); }