Merge branch 'main' of ssh://patema.crystalyx.net:2222/GameJams/Snaparazzi
This commit is contained in:
commit
bbb2a98412
@ -303,24 +303,22 @@ private void OnRoomUpdate(object sender, ValueChangedEventArgs e)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(myRoom.currentState != (int)lastState)
|
if (myRoom.currentState != (int)lastState)
|
||||||
{
|
{
|
||||||
OnNewGameState();
|
OnNewGameState();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
//call this every time we are on this state
|
||||||
|
switch (myRoom.currentState)
|
||||||
{
|
{
|
||||||
//call this every time we are on this state
|
case (int)GameState.WaitingForOtherPlayersToJoin:
|
||||||
switch (myRoom.currentState)
|
{
|
||||||
{
|
CheckIfIAmTheFirst(myRoom.GetPlayerList());
|
||||||
case (int)GameState.WaitingForOtherPlayersToJoin:
|
UpdateDisplayedListUser(myRoom.GetPlayerList());
|
||||||
{
|
|
||||||
CheckIfIAmTheFirst(myRoom.GetPlayerList());
|
|
||||||
UpdateDisplayedListUser(myRoom.GetPlayerList());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -401,7 +399,7 @@ public void WaitForPlayers()
|
|||||||
{
|
{
|
||||||
TakePicture.SetActive(false);
|
TakePicture.SetActive(false);
|
||||||
}
|
}
|
||||||
if(VotePicture.activeInHierarchy)
|
if (VotePicture.activeInHierarchy)
|
||||||
{
|
{
|
||||||
VotePicture.SetActive(false);
|
VotePicture.SetActive(false);
|
||||||
}
|
}
|
||||||
@ -524,7 +522,7 @@ public void OnClickProposition(int propositionNumber)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
List<string> voters = myRoom.questions[myRoom.currentQuestionId].propositions[propositionNumber].voters;
|
List<string> voters = myRoom.questions[myRoom.currentQuestionId].propositions[propositionNumber].voters;
|
||||||
if(voters == null)
|
if (voters == null)
|
||||||
voters = new List<string>();
|
voters = new List<string>();
|
||||||
|
|
||||||
voters.Add(currentPlayer.id);
|
voters.Add(currentPlayer.id);
|
||||||
|
@ -31,7 +31,7 @@ void OnDisable()
|
|||||||
void Redraw(int currentQuestion)
|
void Redraw(int currentQuestion)
|
||||||
{
|
{
|
||||||
Prompt prompt = promptList.prompts.Find(x => x.id == player2questions[currentQuestion].promptId);
|
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);
|
explainText.SetText(prompt.en);
|
||||||
|
|
||||||
CameraManager cameraManager = gameObject.GetComponent<CameraManager>();
|
CameraManager cameraManager = gameObject.GetComponent<CameraManager>();
|
||||||
@ -52,7 +52,8 @@ public void OnSubmitButton()
|
|||||||
gameManager.myRoom.code,
|
gameManager.myRoom.code,
|
||||||
gameManager.currentPlayer.id,
|
gameManager.currentPlayer.id,
|
||||||
currentQuestion,
|
currentQuestion,
|
||||||
GetPropRef(gameManager.currentPlayer), succeed =>
|
GetPropRef(gameManager.currentPlayer),
|
||||||
|
succeed =>
|
||||||
{
|
{
|
||||||
if(!succeed)
|
if(!succeed)
|
||||||
{
|
{
|
||||||
|
@ -49,7 +49,7 @@ public void UploadPhoto(string roomCode, string playerId, int question, int prop
|
|||||||
string path = $"{roomCode}/{playerId}/{imageUuid}.png";
|
string path = $"{roomCode}/{playerId}/{imageUuid}.png";
|
||||||
StorageReference imageRef = storage.Child(path);
|
StorageReference imageRef = storage.Child(path);
|
||||||
|
|
||||||
imageRef.PutBytesAsync(photoBytes).ContinueWith((Task<StorageMetadata> task) =>
|
imageRef.PutBytesAsync(photoBytes).ContinueWithOnMainThread(task =>
|
||||||
{
|
{
|
||||||
if (task.IsFaulted || task.IsCanceled)
|
if (task.IsFaulted || task.IsCanceled)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user