Пример #1
0
    void Shoot()
    {
        _timer += Time.deltaTime;

        if (_timer >= _fireRate)
        {
            if (Input.GetButton("Fire1"))
            {
                _timer = 0f;
                _anim.EnemyShoot();
                FireGun();
                _muzzleFlash.Play();
                audioSource.PlayOneShot(gunSound);
            }
        }
    }
Пример #2
0
 private void PlayShootAnim()
 {
     anim.EnemyShoot();
     audioSource.PlayOneShot(shootClip);
 }