From cf0a4d578cd6ea0900bd8ab1afc2017e083eb9d5 Mon Sep 17 00:00:00 2001 From: Fangh Date: Sun, 4 Feb 2024 14:09:04 +0100 Subject: [PATCH] fix: display first page and unsubscribe from your old room --- Assets/Scripts/RoomManager.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/RoomManager.cs b/Assets/Scripts/RoomManager.cs index 734f433..9dd62c9 100644 --- a/Assets/Scripts/RoomManager.cs +++ b/Assets/Scripts/RoomManager.cs @@ -62,6 +62,8 @@ private void InitializeFirstPage() explanationPage.SetActive(false); waitForPropositionsPage.gameObject.SetActive(false); votingPage.gameObject.SetActive(false); + scoringPage.gameObject.SetActive(false); + waitingForPlayersPage.SetActive(true); ResetAllPlayerLabels(); } @@ -133,11 +135,13 @@ private IEnumerator Coroutine_ClearCurrentRoom(Action callback_OnRoomClear = nul if(myRoom == null || string.IsNullOrEmpty(myRoom.code)) { yield return null; - Debug.Log("There is no room to clean", this); + Debug.Log("There is no last room to clean", this); callback_OnRoomClear?.Invoke(); } else { + realtimeDB.Child("rooms").Child(myRoom.code).ValueChanged -= OnRoomUpdate; + Debug.Log($"delete files of room {myRoom.code} from storage", this); StorageManager.Instance.DeleteFileOfRoom(myRoom, () => { @@ -309,6 +313,7 @@ private void OnNewGameStateStarted() { case (int)GameState.EnteringName: //if game has been reset by a player on mobile ClearOldAndCreateNewRoom(); + InitializeFirstPage(); break; case (int)GameState.WaitingForOtherPlayersToJoin: