fix: stop sending request to server 60time per seconds
This commit is contained in:
parent
61bdd410fe
commit
6898ac3a84
@ -77,7 +77,7 @@ private void Update()
|
|||||||
|
|
||||||
private void SendRoomState(GameState _newState)
|
private void SendRoomState(GameState _newState)
|
||||||
{
|
{
|
||||||
Debug.Log($"sending to RTDB that we are now in the {_newState} state", this);
|
//Debug.Log($"sending to RTDB that we are now in the {_newState} state", this);
|
||||||
realtimeDB.Child("rooms").Child(myRoom.code).Child("currentState").SetValueAsync((int)_newState);
|
realtimeDB.Child("rooms").Child(myRoom.code).Child("currentState").SetValueAsync((int)_newState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,6 +54,8 @@ private void Update()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
OnVoteEnded?.Invoke();
|
OnVoteEnded?.Invoke();
|
||||||
|
OnVoteEnded = null;
|
||||||
|
gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,6 @@ public void OnRoomUpdate(Room _myRoom)
|
|||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
|
|
||||||
//while MakeProposition State
|
//while MakeProposition State
|
||||||
if (endOfPropositionDate != DateTime.MinValue)
|
if (endOfPropositionDate != DateTime.MinValue)
|
||||||
{
|
{
|
||||||
@ -46,6 +45,8 @@ void Update()
|
|||||||
if (duration.TotalMilliseconds <= 0 || allPlayersHasProposedTwoPictures)
|
if (duration.TotalMilliseconds <= 0 || allPlayersHasProposedTwoPictures)
|
||||||
{
|
{
|
||||||
OnPropositionFinish?.Invoke();
|
OnPropositionFinish?.Invoke();
|
||||||
|
OnPropositionFinish = null;
|
||||||
|
gameObject.SetActive(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,7 +104,7 @@ private void CheckPlayersWhoHaveProposed()
|
|||||||
playerLabels.Find(x => x.text == player.name).color = Color.green;
|
playerLabels.Find(x => x.text == player.name).color = Color.green;
|
||||||
playersIdWhoHaveProposed.Add(player.id);
|
playersIdWhoHaveProposed.Add(player.id);
|
||||||
}
|
}
|
||||||
Debug.Log($"{playersIdWhoHaveProposed.Count}/{myRoom.players.Count} players have answered.", this);
|
//Debug.Log($"{playersIdWhoHaveProposed.Count}/{myRoom.players.Count} players have answered.", this);
|
||||||
if(playersIdWhoHaveProposed.Count == myRoom.players.Count)
|
if(playersIdWhoHaveProposed.Count == myRoom.players.Count)
|
||||||
{
|
{
|
||||||
allPlayersHasProposedTwoPictures = true;
|
allPlayersHasProposedTwoPictures = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user