Using panels to visually outline the inventory UI area and individual items
There are four kinds of objects we see when playing a game:
- GameObjects that have some visual elements, such as 2D and 3D objects.
- UI elements located in World Space, so they appear next to GameObjects in the scene.
- UI elements located in Screen Space - Camera, so they appear at a fixed distance from the camera (but can be obscured by GameObjects closer to the camera than these UI elements).
- UI elements located in Screen Space - Overlay. These always appear above the other three kinds of visual elements and are perfect for Heads-Up Display (HUD) elements, such as inventories.
Sometimes, we want to visually make it clear which elements are part of the UI’s HUD and which are visual objects in the scene. HUDs are often used to display multiple pieces of information at once, such as the player’s health, inventory, and game progress (score or level). Using Unity...