From 825c69fcc1615eda0a1fdc8db0649e53f3fd6c4f Mon Sep 17 00:00:00 2001 From: Fangh Date: Sun, 4 Feb 2024 12:23:12 +0100 Subject: [PATCH] add debug logs --- Assets/Scripts/GameManager.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 766390b..380f46f 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -285,7 +285,6 @@ public void StartGame() /// private void OnRoomUpdate(object sender, ValueChangedEventArgs e) { - Debug.Log("begin OnRoomUpdate"); GameState lastState = (GameState)myRoom.currentState; try @@ -294,8 +293,8 @@ private void OnRoomUpdate(object sender, ValueChangedEventArgs e) if (e?.Snapshot?.GetRawJsonValue() != null) { string JSON = e.Snapshot.GetRawJsonValue(); + Debug.Log($"Room has been updated : {JSON}", this); myRoom = JsonConvert.DeserializeObject(e.Snapshot.GetRawJsonValue()); - } } catch (Exception ex) @@ -304,7 +303,7 @@ private void OnRoomUpdate(object sender, ValueChangedEventArgs e) } if (myRoom == null) { - Debug.Log("myroom is null"); + Debug.LogError("Got an update for an empty room.", this); return; } @@ -347,7 +346,9 @@ private void OnNewGameState() } case (int)GameState.Explanation: { + Debug.Log("Explanation time.", this); EndGame.SetActive(false); + WaitingOtherPlayers.SetActive(false); WaitingRoom.SetActive(false); BeforeStart.SetActive(true); endOfViewDate = DateTime.Now.AddSeconds(4);