-
Notifications
You must be signed in to change notification settings - Fork 15
7. Mini Game UI
This page contains information about scripts which display key UI information during a mini game such as current mini game state, mini game winner/loser, and game time remaining.
File: MiniGameManagerMessageUI.cs
The script will listen for game loop events from the Mini Game Manager and update a TextMeshPro text UI item each event trigger. The specific events are:
UI displays "3", "2", "1", then the specified countdown message in the MiniGameManager.CountDownStartMessage field (value in the inspector).
UI displays "Finish!" when time runs out.
UI displays which player won or if the game was a tie. If an error text displays, it means no script has set the winner. One of your scripts must assign the game winner via the MiniGameManager.Winner property before this time.
There are two timer variants. One that displays time as a decimal number (float) called MiniGameManagerFloatTimerUI.cs and another that displays time as a whole number (integer) MiniGameManagerIntTimerUI.cs.
Only use one of these two scripts per scene.
The script will listen for time events from the Mini Game Manager and update a TextMeshPro text UI item each event trigger and display the remaining time in a mini game.
Before the game begins, the full amount of time set on the MiniGameManager will be shown. Once the game begins, the remaining time in seconds will be show with the Int timer, while the Float timer will display time using the specified Format string field on the timer script. By default, the format includes two decimal places.