void Shoot() { _timer += Time.deltaTime; if (_timer >= _fireRate) { if (Input.GetButton("Fire1")) { _timer = 0f; _anim.EnemyShoot(); FireGun(); _muzzleFlash.Play(); audioSource.PlayOneShot(gunSound); } } }
private void PlayShootAnim() { anim.EnemyShoot(); audioSource.PlayOneShot(shootClip); }