// Restart Game private void RestartGame_Enter() { Debug.Log("[RestartGame] Enter"); // Clear all groups. ClearAllGroups(); // Master client clear propriety for next match. if (PhotonNetwork.isMasterClient) { PhotonUtils.SetRoomCustomProperty(PhotonPropertyKey.s_RoomCustomPropertyKey_GameFinishedStartTimeAlreadySet, false); } // Open loading. if (m_LoadingPanel != null) { m_LoadingPanel.Present(); } // Stop photon queue. PhotonNetwork.isMessageQueueRunning = false; // Stop music. MusicPlayer.StopMain(); MusicPlayer.SetPlaylistMain(null); // Proceed to game scene. SceneManager.LoadSceneAsync("MultiplayerGame", LoadSceneMode.Single); }
private void UpdateGameFinishedStartTime() { if (!PhotonNetwork.isMasterClient) { return; } Room room = PhotonNetwork.room; if (room == null) { return; } if (PhotonNetwork.time < 0.0001f) { m_GameFinishedTimeSynced = false; return; } if (!m_GameFinishedTimePropertyAlreadySet) { PhotonUtils.SetRoomCustomProperty(PhotonPropertyKey.s_RoomCustomPropertyKey_GameFinishedStartTime, PhotonNetwork.time); PhotonUtils.SetRoomCustomProperty(PhotonPropertyKey.s_RoomCustomPropertyKey_GameFinishedStartTimeAlreadySet, true); m_GameFinishedTimePropertyAlreadySet = true; } }
private void WriteRoomProperty(int i_Ping) { PhotonUtils.SetRoomCustomProperty(PhotonPropertyKey.s_RoomCustomPropertyKey_AvgPing, i_Ping); }