To create a C# inventory slot display script component, follow these steps:
- Import the _Scripts folder from the provided files (this contains a copy of the script class PlayerInventory from one of the previous recipes, which we can use unchanged for this recipe).
- Delete two of the three inventory slot GameObjects: Panel-inventory-slot (1) and (2). So, only Panel-inventory-slot remains.
- First we'll create a panel for three star slots. In the Hierarchy panel, create a UI Panel (Create | UI | Panel) and rename it Panel-stars.
- We'll now position Panel-stars at the top-left of the Game panel, and make it fit within the left side of our general inventory rectangle. Edit the UI Image's Rect Transform component, and while holding ...