diff --git a/Assets/Scripts/DatabaseClasses/Room.cs b/Assets/Scripts/DatabaseClasses/Room.cs index b316614..b511ddc 100644 --- a/Assets/Scripts/DatabaseClasses/Room.cs +++ b/Assets/Scripts/DatabaseClasses/Room.cs @@ -96,12 +96,6 @@ public List GetQuestionsByPlayer(Player player) return playerQuestions; } - - public void SetPlayersAreReady(int _state) - { - currentState = _state; - } - /// /// Return all the propositions linked to a specific player. /// diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 30476d3..5dc225a 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -207,8 +207,8 @@ public void PlayerValidateNameAndServerRoom(string _name, string _code) else { myOnlineRoom = realtimeDB.Child("rooms").Child(_code); - //subscribe to it - myOnlineRoom.ValueChanged += OnRoomUpdate; + //subscribe to it + myOnlineRoom.ValueChanged += OnRoomUpdate; //if room exists, join it JoinRoom(() => { @@ -282,7 +282,6 @@ private void JoinRoom(Action callback_OnRoomJoined) public void StartGame() { // send Start Game - myRoom.SetPlayersAreReady(1); string JSON = JsonUtility.ToJson(myRoom); Debug.Log(JSON); try @@ -290,7 +289,6 @@ public void StartGame() SendCurrentState(GameState.Explanation, () => { Debug.Log($"start the game", this); - myRoom.currentState = (int)GameState.Explanation; WaitingRoom.SetActive(false); BeforeStart.SetActive(true);