To toggle carrying and not-carrying icons for a single-object pickup, follow these steps:
- Start with a new copy of the Simple2Dgame_SpaceGirl mini-game.
- Import the _Scripts folder from the provided files (this contains a copy of the PlayerInventory script class from the previous recipe, which we can use unchanged for this recipe).
- Add a UI Image object to the scene (GameObject | UI | Image). Rename it Image-star-icon.
- With Image-star-icon selected in the Hierarchy window, drag the icon_nostar_100 sprite (in the Sprites folder) from the Project window into the Source Image field in the Inspector window (in the Image (Script) component).
- Click on the Set Native Size button for the Image component. This will resize the UI image so that it fits the physical pixel's width and height of the icon_nostar_100 sprite file:

Figure 3.12 – Image source and native size settings
- Position the image icon at the...