diff --git a/Assets/Scripts/RoomManager.cs b/Assets/Scripts/RoomManager.cs index f7a2f5d..2da09a5 100644 --- a/Assets/Scripts/RoomManager.cs +++ b/Assets/Scripts/RoomManager.cs @@ -77,7 +77,7 @@ private void Update() private void SendRoomState(GameState _newState) { - Debug.Log($"sending to RTDB that we are now in the {_newState} state", this); + //Debug.Log($"sending to RTDB that we are now in the {_newState} state", this); realtimeDB.Child("rooms").Child(myRoom.code).Child("currentState").SetValueAsync((int)_newState); } diff --git a/Assets/Scripts/VotingPage.cs b/Assets/Scripts/VotingPage.cs index 12fec1f..36f58ae 100644 --- a/Assets/Scripts/VotingPage.cs +++ b/Assets/Scripts/VotingPage.cs @@ -54,6 +54,8 @@ private void Update() else { OnVoteEnded?.Invoke(); + OnVoteEnded = null; + gameObject.SetActive(false); } } } diff --git a/Assets/Scripts/WaitForPropositionsPage.cs b/Assets/Scripts/WaitForPropositionsPage.cs index 194fb62..73f2903 100644 --- a/Assets/Scripts/WaitForPropositionsPage.cs +++ b/Assets/Scripts/WaitForPropositionsPage.cs @@ -36,7 +36,6 @@ public void OnRoomUpdate(Room _myRoom) // Update is called once per frame void Update() { - //while MakeProposition State if (endOfPropositionDate != DateTime.MinValue) { @@ -46,6 +45,8 @@ void Update() if (duration.TotalMilliseconds <= 0 || allPlayersHasProposedTwoPictures) { OnPropositionFinish?.Invoke(); + OnPropositionFinish = null; + gameObject.SetActive(false); return; } @@ -103,7 +104,7 @@ private void CheckPlayersWhoHaveProposed() playerLabels.Find(x => x.text == player.name).color = Color.green; playersIdWhoHaveProposed.Add(player.id); } - Debug.Log($"{playersIdWhoHaveProposed.Count}/{myRoom.players.Count} players have answered.", this); + //Debug.Log($"{playersIdWhoHaveProposed.Count}/{myRoom.players.Count} players have answered.", this); if(playersIdWhoHaveProposed.Count == myRoom.players.Count) { allPlayersHasProposedTwoPictures = true;