Creating the Lives Remaining UI components

In this section, we will add three images of the Cucumber Man's head beneath the health label and meter, each image representing a life remaining:

  1. Download the cmLives.png file from the publisher's website
  2. Drag that image into the Assets | Cucumber Man folder in the Project panel
  3. Select the imported image and, in the Inspector panel, change the Texture Type to Sprite (2D and UI)
  4. In the Hierarchy panel, right-click the HUD_Canvas and select UI | Image
  5. In the Inspector panel, click the small circle to the right of the setting under Image (Script) | Source Image
  6. Select the cmLives.png image you added in step 2
  7. In the Inspector panel, rename this image as Life1
  8. Click Rect Transform | Scale  and change the scale of Life1 to 0.4 for X, Y, and Z
  9. In the Scene view, reposition the Life1 image so that it is directly preceding the health label
  10. In the Hierarchy panel, right-click and duplicate Life1 twice, and rename the copies Life2 and Life3

 

  1. In the Scene view, reposition the three images so that they are in sequential order and aligned in a visually pleasing manner

Your finished work should look similar to the following screenshot from the Game view:

Make any necessary adjustments before moving on to the next section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset