Chapter 12. The User Interface
This is a great time to introduce some UI (User Interface) into our game. We will construct and implement a simple, dynamic user interface using Unity's built-in UI system.
In this chapter, we will cover the following topics:
- Introducting the Unity UI
- Creating UI Views
- Connecting buttons to actions
- Switching UI views
So far, our sole focus was on learning how to code. I would like to make a little exception in this chapter and talk about coding the UI functionality as well as creating a good-looking UI. You probably already know what a user interface is, right? If not, we will cover it very briefly.
A UI is a bridge between a human and a computer program. All user interactions with your game will be happening in the user interface. In simple words, all buttons on the screen, labels, as well as mouse- and keyboard-driven events are part of the UI.
The main part of the UI is the Graphical User Interface (GUI). The GUI is simply whatever is visible on...