Game Development Reference
In-Depth Information
Am I dead yet?
For the health bar, we'll reuse some of the tricks you learned in previous chapters
but with some nicer graphics using our
Doomstalker
free UI bits.
So let's start by adding a panel to the
Canvas
. Right-click on the
Canvas
in the project
hierarchy and select
UI
|
Panel
. Once done, rename this new GameObject
HealthUIPanel
.
You could alternatively use the
Image
UI component as a start if
you wish; they are pretty much identical. The only real difference,
is that the
Panel
starts its life stretched to the full size of the
Canvas
and has a default background image, whereas the
Image
starts off
smaller with no preset image. They are still exactly the same, but
with different defaults.
Your
Scene
view will now look like what is shown in the following screenshot: