How could we cope with many inventory slots, more than fit in the space provided? One solution is to add a scroll bar so that the user can scroll left and right, viewing five at a time, say, as shown in the following screenshot.
Let's add a horizontal scroll bar to our game. This can be achieved without any C# code changes, all through the Unity 5 UI system.
To implement a horizontal scrollbar for our inventory display, we need to do the following:
- Increase the height of Panel-background to 110 pixels.
- In the Inspector panel, set the Child Alignment property of component Grid Layout ...