Compare commits
2 Commits
e41f0d83d5
...
686b00b8d5
Author | SHA1 | Date | |
---|---|---|---|
686b00b8d5 | |||
5e58f33ea1 |
@ -115,6 +115,19 @@ private void Update()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (myRoom.currentState == (int)GameState.MakeVote && endOfViewDate != DateTime.MinValue)
|
||||
{
|
||||
TimeSpan duration = endOfViewDate - DateTime.Now;
|
||||
counterMakeProposition.text = ((int)duration.TotalSeconds).ToString("D1");
|
||||
|
||||
if (duration.TotalMilliseconds <= 0)
|
||||
{
|
||||
Debug.Log("It's time to finish proposition !");
|
||||
endOfViewDate = DateTime.MinValue;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -462,7 +475,7 @@ public void onClickSamePlayers()
|
||||
{
|
||||
myRoom.currentState = (int)GameState.Explanation;
|
||||
myRoom.questions = null;
|
||||
myRoom.currentQuestionId = string.Empty;
|
||||
myRoom.currentQuestionId = 0;
|
||||
string json = JsonUtility.ToJson(myRoom);
|
||||
|
||||
myOnlineRoom.SetRawJsonValueAsync(json).ContinueWithOnMainThread(task =>
|
||||
@ -477,7 +490,7 @@ public void onClickSamePlayers()
|
||||
public void onClickNewPlayers()
|
||||
{
|
||||
myRoom.currentState = (int)GameState.EnteringName;
|
||||
myRoom.currentQuestionId = string.Empty;
|
||||
myRoom.currentQuestionId = 0;
|
||||
myRoom.questions = null;
|
||||
myRoom.players = null;
|
||||
string json = JsonUtility.ToJson(myRoom);
|
||||
@ -494,8 +507,7 @@ public void onClickNewPlayers()
|
||||
|
||||
public void OnClickProposition(int propositionNumber)
|
||||
{
|
||||
int currentQuestionId = Int32.Parse(myRoom.currentQuestionId);
|
||||
List<string> voters = myRoom.questions[currentQuestionId].propositions[propositionNumber].voters.ToList<string>();
|
||||
List<string> voters = myRoom.questions[myRoom.currentQuestionId].propositions[propositionNumber].voters.ToList<string>();
|
||||
voters.Add(currentPlayer.id);
|
||||
myOnlineRoom.Child("questions").Child(myRoom.currentQuestionId.ToString()).Child("propositions").Child(propositionNumber.ToString()).Child("voters").SetValueAsync(voters);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user