Compare commits

...

2 Commits

Author SHA1 Message Date
Fangh
91d0710ce9 Merge branch 'main' of https://git.crystalyx.net/GameJams/Snaparazzi 2024-01-29 22:19:34 +01:00
Fangh
ad481d6ee3 fix: continueWith => continueWithOnMainThread 2024-01-29 22:19:22 +01:00
3 changed files with 17 additions and 18 deletions

View File

@ -303,12 +303,11 @@ 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)
{
@ -322,7 +321,6 @@ private void OnRoomUpdate(object sender, ValueChangedEventArgs e)
break;
}
}
}
/// <summary>
/// Call this when Game state change
@ -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<string> voters = myRoom.questions[myRoom.currentQuestionId].propositions[propositionNumber].voters;
if(voters == null)
if (voters == null)
voters = new List<string>();
voters.Add(currentPlayer.id);

View File

@ -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<CameraManager>();
@ -52,7 +52,8 @@ public void OnSubmitButton()
gameManager.myRoom.code,
gameManager.currentPlayer.id,
currentQuestion,
GetPropRef(gameManager.currentPlayer), succeed =>
GetPropRef(gameManager.currentPlayer),
succeed =>
{
if(!succeed)
{

View File

@ -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<StorageMetadata> task) =>
imageRef.PutBytesAsync(photoBytes).ContinueWithOnMainThread(task =>
{
if (task.IsFaulted || task.IsCanceled)
{