Understanding Canvas and RectTransform
Currently, there are three UI systems available in Unity for different purposes:
- UI Elements: A system to extend the Unity Editor with custom windows and tools. This uses several web concepts, such as stylesheets and XML-based language, to lay out your UI. In the future, it will be available to use in-game.
- Unity UI: A GameObject-based UI only applicable for in-game UIs (not editor extensions). You create it using GameObjects and components like any other object we have edited so far.
- IMGUI: A legacy code-based UI created entirely by using scripting. A long time ago, this was the only UI system used in both the editor and the in-game UI. Nowadays, it is only used to extend the editor and will soon be completely replaced by UI Elements.
In this chapter, we are only going to focus on in-game UI to communicate different information to the player regarding the state of the game, so we are going to use Unity UI. At the time...