Commit ec27480c authored by mohamed20047's avatar mohamed20047

8. True/False Timer State Bug (Race Condition) (solved)

parent d4cfc2fc
...@@ -202,6 +202,11 @@ namespace com.al_arcade.tf ...@@ -202,6 +202,11 @@ namespace com.al_arcade.tf
_progress++; _progress++;
_score += CalculateStreakScore(); _score += CalculateStreakScore();
// timer before productionLine to avoid Race Condition
UpdateTimerBy(4f);
uiManager?.UpdateTimer(_timeLeft, true);
if (handController != null) handController.PlayCorrectFeedback(playerSaidTrue); if (handController != null) handController.PlayCorrectFeedback(playerSaidTrue);
if (productionLine != null) yield return productionLine.MoveForward(stepDistance); if (productionLine != null) yield return productionLine.MoveForward(stepDistance);
if (questionScreen != null) questionScreen.ShowFeedback(true, _streak); if (questionScreen != null) questionScreen.ShowFeedback(true, _streak);
...@@ -214,8 +219,7 @@ namespace com.al_arcade.tf ...@@ -214,8 +219,7 @@ namespace com.al_arcade.tf
if (particles != null) if (particles != null)
particles.PlayCorrectBurst(new Vector3(-2, 6f, 13)); particles.PlayCorrectBurst(new Vector3(-2, 6f, 13));
UpdateTimerBy(4f);
uiManager?.UpdateTimer(_timeLeft, true);
} }
else else
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment