Displaying multiple pickups of the same object with multiple status icons
If there is a small, fixed total number of an item to be collected rather than text totals, an effective UI approach is to display placeholder icons (empty or grayed out pictures) to show the user how many of the item remain to be collected, and each time an item is picked up, a placeholder icon is replaced by a full color collected icon.
In this recipe, we use gray-filled star icons as the placeholders and yellow-filled star icons to indicate each collected star, as shown in the screenshot:

Getting ready
This recipe assumes that you are starting with the Simple2Dgame_SpaceGirl
project set up in the first recipe in this chapter.
How to do it...
To display multiple inventory icons for multiple pickups of same type of object, follow these steps:
- Start with a new copy of the
Simple2Dgame_SpaceGirl
mini-game. - Create C# Script class
PlayerInventory
in the_Scripts
folder:
using UnityEngine; public class PlayerInventory : MonoBehaviour...