Game Development Reference
In-Depth Information
Once created, drag and drop the power-up object in the Hierarchy panel onto the newly created
Prefab in the Project panel. Doing this completes Prefab creation. The Prefab can now be duplicated
in the same scene, as well as different scenes and projects (see Figure 4-15 ).
Figure 4-15. Completing the power-up Prefab
Creating Other Prefabs
CMOD features not just Cash Power-Ups, which we've created in this chapter, but also ammo-restore,
health-restore, and weapon-upgrade power-ups. Despite the differences in these power-ups, however,
they share the same basic mechanic. They are Billboard sprites with colliders that respond directly to
player collisions, interacting with the NotificationsManager on a GameManager singleton. The chief
difference between them rests not in their mechanics, but in their responses to collisions. The Cash
Power-Up increases Player cash, while health-restore affects Player health, and weapon-upgrade
changes the Player weapon, and so on. Their differences rest in what they actually do when a Player
collision occurs, but not in how collisions are fundamentally detected and handled.
 
Search WWH ::




Custom Search