To display the inventory total text for multiple pickups of different object types, follow these steps:
- Start with a new copy of the Simple2Dgame_SpaceGirl mini-game.
- Edit the tags, changing star to Pickup. Ensure that the star GameObject now has the Pickup tag:

Figure 3.34 – Changing star to Pickup
- Add the following C# PickUp script class to the star GameObject in the Hierarchy window:
using UnityEngine; using System.Collections; public class PickUp : MonoBehaviour { public string description; }
- In the Inspector window, change the description property of the PickUp (Script) component of the star GameObject to star:

Figure 3.35 – Setting the description property of the PickUp (Script) component to star
- Select the star GameObject in the Hierarchy window and make a copy of it, renaming the copy heart.
- In the Inspector window, change the description property of the ...