Chapter 3: Developing UI with the Unity UI System
The UI is very important for a game, and Unity offers three different UI solutions for game developers. They are the Immediate Mode Graphical User Interface (IMGUI), the Unity UI (uGUI) package, and the UI Toolkit. IMGUI is a relatively old UI solution in Unity and it is not recommended for building a runtime UI. The UI Toolkit is the latest UI solution; however, it is still missing some features you can find in the uGUI package and IMGUI. The uGUI package is a mature UI solution in Unity that is widely used in the game industry. Therefore, this chapter will introduce how to use uGUI to develop the UI of your game.
We will cover the following key topics in this chapter:
- C# scripts and common UI elements in Unity
- C# scripts and the UI Event System in Unity
- The Model-View-ViewModel (MVVM) pattern and the UI
- Performance tips to increase performance of the UI
Let's get started!