diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 9dcccee..dfe441b 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -303,24 +303,22 @@ private void OnRoomUpdate(object sender, ValueChangedEventArgs e) return; } - if(myRoom.currentState != (int)lastState) + if (myRoom.currentState != (int)lastState) { OnNewGameState(); } - else + + //call this every time we are on this state + switch (myRoom.currentState) { - //call this every time we are on this state - switch (myRoom.currentState) - { - case (int)GameState.WaitingForOtherPlayersToJoin: - { - CheckIfIAmTheFirst(myRoom.GetPlayerList()); - UpdateDisplayedListUser(myRoom.GetPlayerList()); - break; - } - default: + case (int)GameState.WaitingForOtherPlayersToJoin: + { + CheckIfIAmTheFirst(myRoom.GetPlayerList()); + UpdateDisplayedListUser(myRoom.GetPlayerList()); break; - } + } + default: + break; } } @@ -401,7 +399,7 @@ public void WaitForPlayers() { TakePicture.SetActive(false); } - if(VotePicture.activeInHierarchy) + if (VotePicture.activeInHierarchy) { VotePicture.SetActive(false); } @@ -524,7 +522,7 @@ public void OnClickProposition(int propositionNumber) */ List voters = myRoom.questions[myRoom.currentQuestionId].propositions[propositionNumber].voters; - if(voters == null) + if (voters == null) voters = new List(); voters.Add(currentPlayer.id); diff --git a/Assets/Scripts/QuestionHandler.cs b/Assets/Scripts/QuestionHandler.cs index e141cd3..2aa3583 100644 --- a/Assets/Scripts/QuestionHandler.cs +++ b/Assets/Scripts/QuestionHandler.cs @@ -31,7 +31,7 @@ void OnDisable() void Redraw(int currentQuestion) { Prompt prompt = promptList.prompts.Find(x => x.id == player2questions[currentQuestion].promptId); - Debug.Log(JsonUtility.ToJson(prompt)); + //Debug.Log(JsonUtility.ToJson(prompt)); explainText.SetText(prompt.en); CameraManager cameraManager = gameObject.GetComponent(); @@ -52,7 +52,8 @@ public void OnSubmitButton() gameManager.myRoom.code, gameManager.currentPlayer.id, currentQuestion, - GetPropRef(gameManager.currentPlayer), succeed => + GetPropRef(gameManager.currentPlayer), + succeed => { if(!succeed) { diff --git a/Assets/Scripts/StorageManager.cs b/Assets/Scripts/StorageManager.cs index 9f5c8d2..185c226 100644 --- a/Assets/Scripts/StorageManager.cs +++ b/Assets/Scripts/StorageManager.cs @@ -49,7 +49,7 @@ public void UploadPhoto(string roomCode, string playerId, int question, int prop string path = $"{roomCode}/{playerId}/{imageUuid}.png"; StorageReference imageRef = storage.Child(path); - imageRef.PutBytesAsync(photoBytes).ContinueWith((Task task) => + imageRef.PutBytesAsync(photoBytes).ContinueWithOnMainThread(task => { if (task.IsFaulted || task.IsCanceled) {