Complete the code to update the UI text with the player's score.
scoreText.text = "Score: " + [1].ToString();
The UI text should display the current player's score, which is stored in playerScore.
Complete the code to show the game over panel when the game ends.
if (gameState == GameState.GameOver) { [1].SetActive(true); }
The gameOverPanel UI element should be activated to show the game over screen.
Fix the error in the code that updates the health bar UI.
healthBar.fillAmount = [1] / maxHealth;The health bar fill amount should be the ratio of currentHealth to maxHealth.
Fill both blanks to create a dictionary that maps game states to UI panels.
Dictionary<GameState, GameObject> uiPanels = new Dictionary<GameState, GameObject> {
{ GameState.Playing, [1] },
{ GameState.Paused, [2] }
};The playingPanel corresponds to the Playing state, and pausedPanel corresponds to the Paused state.
Fill all three blanks to update the UI only when the game state changes.
if (currentState != [1]) { currentState = [2]; UpdateUI([3]); }
We check if currentState is different, then assign newState to currentState, and update the UI with newState.