Simple Countdown Timer for Unity
A downloadable asset pack
About:
This is a simple countdown timer for developers who don't want to spend time creating their own for their projects. Feel free to use this commercially or non-commercially. Feedback and constructive criticism will be highly appreciated, so please feel free to let me know how I can improve for my future projects!
Features:
- Display format includes:
- Second
- Minute:Second
- Hour:Minute:Second
- Option to repeat
- Timer delay functionality
- Control single or multiple timers in a scene
- Add custom events when timer reaches a certain point
- Progress bar functionality
- Customize color and UI display
- Demo included in the project
Quickstart:
- Create an empty game object and attach the Timer component.
- Create another game object and attach the TimerManager component, which will contain a list of timers.
- Create a TextMeshPro-Text game object and attach the TimerUI component
- Serialize the values for each script in the inspector. Duration should be converted to seconds by either multiplying minutes by 60 or hours by 3600.
Alternatively, you can create a new Timer in code using the CreateTimer method in the TimerManager class.
- Set the TimerUI's timer property to the new timer. This will automatically set the Timer in the TimerUI component's Timer field when playing.
- Use the TimerManager class' methods to start/stop/pause/resume/restart timers.
- A new Timer will be added as a child of the TimerManager game object.
To add a custom event when the timer reaches a certain point, invoke the OnCustomEvent anywhere in the CountDownTimer method in the Timer class.
**Note**
Deselecting the "Start On Awake" bool in the Timer component will require you to use the StartTimer method from the TimerManager class wherever you wish to start the timer.
Github:
Download
Click download now to get access to the following files:
Leave a comment
Log in with itch.io to leave a comment.