Game Development Reference
In-Depth Information
public void Reload () {
ammoCount = 20;
_rocketUI.UpdateUI(ammoCount);
}
}
9. Finally, we will go back to Unity and add the
RocketLauncher
script to the
RocketLauncher
object in the
Hierarchy
view. Then, go to its
Inspector
view
and set it as follows:
Transform
X
:
6.5
Y
:
0.25
Z
:
0
Position
X
:
0
Y
:
90
Z
:
0
Rotation
X
:
1
Y
:
1
Z
:
1
Scale
Rocket Launcher
(script)
Smoke
Smoke
(drag the
Smoke
object located in
robot/gun_model
in the
Hierarchy
view)
Rocket
rocket
(drag the
rocket
prefab located in the
Resources/Prefabs
folder in the
Project
view)
We are done. Click on play to see the result!