Game Development Reference
In-Depth Information
To draw our stats on the screen, we use labels to show some text as well as the
associating variables. For the Time Played stat, we divide it by 60 so it will show
how many minutes have passed. In Unity, time is tracked by seconds, so we show
minutes instead so that there isn't a large and possibly confusing number shown to
the player.
To give our script a quick test, create a new scene and place the script onto the cam-
era. Be sure to set the showStats Boolean variable to true in the Inspector win-
dow. You should see this on your screen:
Each of the stats we wanted to track is now shown on the screen in a vertical list.
Later in this topic, when we put everything together to finish our game, we will tie this
into our menu system.
Search WWH ::




Custom Search