DungeonShooter

Work in progress

Engine Icon Platform Icon Platform Icon Solo Engine Icon Platform Icon Platform Icon Solo

My Work

 protected override void Shoot(InputAction.CallbackContext context)
 {
     if (CheckAmmo() && this.isReloading == false)
     {
         bulletSpawner.Shoot(name);
         this.currentAmmo--;
         if (soundController != null)
             soundController.ShotSound();
     }
     else
     {
         if (soundController != null)
             soundController.EmptyShotSound();
     }
 }

 private void ReloadCall(InputAction.CallbackContext context)
 {
     if (!this.isReloading)
     {
         StartCoroutine(Reload());
         StartCoroutine(soundController.ReloadSound(reloadSpeed));
     }
 }

 protected override IEnumerator Reload()
 {
     this.isReloading = true;
     yield return new WaitForSeconds(reloadSpeed);
     this.currentAmmo = ammo;
     this.isReloading = false;
     Debug.Log("Reloaded");
 }


 protected override bool CheckAmmo()
 {
     if (this.currentAmmo > 0)
         return true;
     else return false;
 }
                                     

oops something whent wrong, reload the page

About the game

Technique