In this section, we will create and edit a script to manage our points and to display them on our game's HUD. Here are the steps:
- In the Hierarchy panel, select the HUD_Canvas | Score_Value
- In the Inspector panel, click the Add Component button
- Select New Script and name the script PointsManager
- In the Project panel, click Favorites | All Scripts
- Drag the PointsManager script to the Assets | Custom Scripts folder
- Double-click the PointsManager script to open it in an editor
- Edit the script so that it matches the following code
The first section of the code contains the namespace import statements and the PointsManager class declaration:
using System.Collections; using System.Collections.Generic; using