diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index bc2dd8c..89b153c 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -297,6 +297,8 @@ public void StartGame() /// private void OnRoomUpdate(object sender, ValueChangedEventArgs e) { + GameState lastState = myRoom != null ? (GameState)myRoom.currentState : GameState.EnteringName; + try { if (e?.Snapshot?.GetRawJsonValue() != null) @@ -316,7 +318,6 @@ private void OnRoomUpdate(object sender, ValueChangedEventArgs e) return; } - GameState lastState = (GameState)myRoom.currentState; Debug.Log($"lasState = {lastState}. Currentstep = {(GameState)myRoom.currentState}", this); if (myRoom.currentState != (int)lastState)