PowerUp +Ammo
Objective:
1. Create a power-up that refills the Ammo Count.
2. Add a Sound Effect to Refill Ammo
3. Add a 3D model to collect
4. Reloading Sound Effect
Featured Image:
Deciding on an Ammo Collectible:
I am decided on this type of ammo icon (3D).
Sound: Just looked for some Sifi reload sounds
PowerUpBehavior.cs
Code:
Added more conditions. Yes, this breaks the Open and close principle.
Player.cs:
PowerUpBehavior calls this Method from Player.cs
From a future article but when ammo is refilled/reset, a check for an ammo update/count to fire or will skip the rest of the code in UseLaserPool() by a return when _ammoBank is ≤ 0
SpawnManager:
Drag and drop Ammo collectibles
AmmoAnimation.cs:
This simple rotation when Active, animation Should always be in FixedUpdate.
Game Play Video:
Thanks for Reading…
.
.
.