In the previous recipe, we started to work with UI panels and images to create a more general-purpose GameObject for displaying inventory slots, as well as images to indicate what is stored in them. In this recipe, we will take things a little further with the graphics and also create a C# script class that works with each inventory slot object:
![](https://static.packt-cdn.com/products/9781839217616/graphics/assets/45082df1-a55b-4b9a-9e81-d66f23e551ec.png)
Figure 3.22 – Example showing two items, each with three slots
As shown in the preceding screenshot, in this recipe, we'll create a UI (and scripts) for an inventory that has three locations for stars, and three more for keys, using colored and gray icons to indicate how many have been collected.