Countdown Controller
Last updated
Last updated
Presented by ICountdownController interface, this system allows to start countdown with needed time length, invoke certain action each tick and in the end of such countdown. It will also show descending numbers via IUIController in the center of screen and play tick sounds if they were assigned.
To use this system, inject ICountdownController interface into your class, as shown below:
countdownSounds – you can assign your custom sounds for countdown ticks (starting from 1st, ending by Nth tick, so 0th element in this list will be the last sound before the end of countdown)
It should be like this:
This method starts cooldown with certain length in seconds, it calls tickCallback every tick, endCallback in the end of countdown and cancelCallback in case if countdown is cancelled.
Example (from DuelPlayerController.cs):
This method cancels current countdown and instantly calls cancel callback if it was assigned beforehand by StartCountdown method.