From d9580450cc723e1e705e926e19b1b765180d0b8f Mon Sep 17 00:00:00 2001 From: Fangh Date: Thu, 29 Feb 2024 22:40:18 +0100 Subject: [PATCH] fix(gamemanager): explanationpage is stuck --- Assets/Scripts/GameManager.cs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 5dc225a..bc2dd8c 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -282,17 +282,9 @@ private void JoinRoom(Action callback_OnRoomJoined) public void StartGame() { // send Start Game - string JSON = JsonUtility.ToJson(myRoom); - Debug.Log(JSON); try { - SendCurrentState(GameState.Explanation, () => - { - Debug.Log($"start the game", this); - WaitingRoom.SetActive(false); - BeforeStart.SetActive(true); - - }); + SendCurrentState(GameState.Explanation); } catch (Exception ex) { @@ -473,7 +465,8 @@ private bool CheckIfIAmTheFirst(List players) } return isFirst; } - public void SendCurrentState(GameState state, Action callback_oncCurrentStateSent) + + public void SendCurrentState(GameState state, Action callback_onCurrentStateSent = null) { myOnlineRoom.Child("currentState").SetValueAsync((int)state).ContinueWithOnMainThread(task => { @@ -483,10 +476,9 @@ public void SendCurrentState(GameState state, Action callback_oncCurrentStateSen } else { - callback_oncCurrentStateSent?.Invoke(); + callback_onCurrentStateSent?.Invoke(); } - }); ; - + }); } public void OnClickSubmitSignIn()