Preparing the scene for the UI
Now that we have a good understanding of the UI system, it's time to implement something within our game to practice a little bit. But the most important outcome from the rest of the chapter is to understand how to program UI within the framework of Unity.
First of all, we need to create a Canvas in our scene, and as a consequence, an event system will also be created. You can do it by right-clicking on the Hierarchy panel and then navigating to UI | Canvas. Select the Canvas object from the Inspector and tweak the options in the Inspector based on your needs. This really depends on your target platform (more on this in the last chapter of this book), and the best way to understand which of these options suit your needs is to test and test and test again.
The next step is to have a nice background for our interface. We got a really nice blue bar in our package that you can find in the Graphics/UI
folder. In order to place it within our interface, let's create...