Game Development Reference
In-Depth Information
Implementing the GUI
Adding the script
Drag-and-drop the
GUI_2D
script onto the First Person Controller. Since we already
have everything coded, your work is almost done for the GUI! In the scene, create
a new empty GameObject and name it
Empty
; this will be used by the script. If you
don't have default values for your
GUI_2D
script, set them to these values:
•
Current HP
to
100
•
Max HP
to
100
•
Current Bar Length
to
0
•
Current Level
to
1
•
Max Experience
to
100
•
Current Experience
to
0
•
Current Exp Bar Length
to
0
•
Max Exp Bar Length
to
100
With all of this added, when you run the scene it should look like this: