/// <summary> /// Makes the server change to the menu scene, and bring all clients with it /// </summary> public void ReturnToMenu(MenuPage returnPage) { MainMenuUI.s_ReturnPage = returnPage; // Update will change scenes once loading screen is visible m_SceneChangeMode = SceneChangeMode.Menu; if (s_IsServer && state == NetworkState.InGame) { // Clear all client's ready states ClearAllReadyStates(); // Tell NetworkPlayers to show their loading screens for (int i = 0; i < connectedPlayers.Count; ++i) { NetworkPlayer player = connectedPlayers [i]; if (player != null) { player.RpcPrepareForLoad(); } } } else { // Show loading screen LoadingModal loading = LoadingModal.s_Instance; if (loading != null) { loading.FadeIn(); } } }
/// <summary> /// Makes the server change to the correct game scene for our map, and tells all clients to do the same /// </summary> public void ProgressToGameScene() { // Clear all client's ready states ClearAllReadyStates(); // Remove us from matchmaking lists UnlistMatch(); // Update will change scenes once loading screen is visible m_SceneChangeMode = SceneChangeMode.Game; // Tell NetworkPlayers to show their loading screens for (int i = 0; i < connectedPlayers.Count; ++i) { NetworkPlayer player = connectedPlayers [i]; if (player != null) { player.RpcPrepareForLoad(); } } }