/*protected virtual void BeginShoot() * { * * } * * protected virtual void CountinueShoot() * { * * } * * protected virtual void EndShoot() * { * * }*/ public void Shoot(int pressureTime) { if (_CanShoot && Ammo > 0) { LeanPool.Spawn(Shell, transform.position, Shell.transform.rotation); LeanPool.Despawn(LeanPool.Spawn(MuzzleFlash.gameObject, transform.position, transform.rotation, transform), MuzzleFlash.main.duration); SoundManager.PlaySound(ShootSound); Ammo--; _CanShoot = false; Coroutiner.Start(Reload()); OnAmmoChangedEvent?.Invoke(); } }
public void AddAmmo(int value) { Ammo += Mathf.Abs(value); OnAmmoChangedEvent?.Invoke(); }