Generalizing multiple icon displays using UI Grid Layout Groups (with scrollbars!)
The recipes in this chapter up to this point have been hand-crafted for each situation. While this is fine, more general and automated approaches to inventory UIs can sometimes save time and effort but still achieve visual and usability results of equal quality. In the next recipe, we will begin to explore a more engineered approach to inventory UIs by exploiting the automated sizing and layouts offered by Unity 5's Grid Layout Group component.

Getting ready
This recipe assumes that you are starting with the project Simple2Dgame_SpaceGirl
setup from the first recipe in this chapter. The font you need can be found in the 1362_02_02
folder.
How to do it...
To display grey and yellow star icons for multiple object pickups using UI grid layout groups, follow these steps:
Start with a new copy of the mini-game
Simple2Dgame_SpaceGirl
.In the Hierarchy panel, create a UI Panel
Panel–background
(Create | UI | Panel).Let...