
Unity Cookbook
By :

Whether it is real-world time or an in-game countdown clock, many games are enhanced by some form of clock or timer display. The following screenshot shows the kind of clock we will be creating in this recipe:
Figure 1.8: Displaying a digital clock when the scene is run
The most straightforward type of clock to display is a string composed of integers for hours, minutes, and seconds, which is what we’ll create in this recipe.
For this recipe, we have prepared the font that you will need in a folder named Fonts
in the 01_01
folder. If you have not done so already, create a Xolonium-Bold SDF
Font Asset file for the imported fonts, as described in the first recipe of this chapter.
To create a digital clock, follow these steps:
Fonts
folder, containing your Xolonium-Bold SDF
Font Asset file.