At this point, we have several scripts working together to give players access to movement, jumping, collecting, and shooting mechanics. However, we're still missing any kind of display or visual cue that shows our player's stats, as well as a way to win and lose the game. We'll focus on these two topics as we close out this last section.
Graphical User Interfaces
User interfaces, commonly referred to as UI, are the visual components of any computer system. The mouse cursor, folder icons, and programs on your laptop are all UI elements. For our game, we want a simple display to let our players know how many items they've collected, their current health, and a text box to give them updates when certain events happen.
UI elements in Unity can be added in two ways:
- Directly from the Create menu in the Hierarchy panel like any other GameObject.
- Using the built-in GUI class in code.