public void AdvanceTurn() { audioManager.PlayGavel(); //prevent the player from triggering this stuff again or undoing any of their actions endTurnUIManager.SetEndTurnButtonInteractable(false); turnManager.BeginTurnTransition(); if (turnManager.NextRound > turnManager.TotalRounds) { StartCoroutine(EndGame()); } else { float transitionDuration = 1.0f; //alert child ui managers to update their information currentTurnUIManager.UpdateTurnDisplay(transitionDuration); //update the background colors of the UI panels var nextPlayer = turnManager.NextPlayer; var targetBackgroundColor = GetBackgroundColorForPlayer(nextPlayer); foreach (var panel in backgroundPanels) { LeanTween.color(panel.rectTransform, targetBackgroundColor, transitionDuration); } //after the transition duration, actually go through with ending the turn Invoke("TurnTransitionsFinished", transitionDuration); } }
public void AdvanceTurn() { audioManager.PlayGavel(); float transitionDuration = 1.0f; //alert child ui managers to update their information currentTurnUIManager.UpdateTurnDisplay(transitionDuration); //prevent the player from triggering this stuff again or undoing any of their actions endTurnUIManager.SetEndTurnButtonInteractable(false); if (turnManager.NextRound > turnManager.TotalRounds) { StartCoroutine(EndGame()); } else { turnManager.AdvanceTurn(); if (turnManager.CurrentPlayer == turnManager.firstPlayer) { StartCoroutine(AITurn()); } else { endTurnUIManager.SetEndTurnButtonInteractable(true); } } }