Work in progress
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;
}