Esempio n. 1
0
        /// <summary>
        /// Fire the weapon. Pools a bullet and the plays the sound and weapon vfx.
        /// </summary>
        public void FireWeapon()
        {
            if (canShoot)
            {
                Poolable bullet = PoolOfPools.GetObjectFromPool(bulletToFire);

                bullet.transform.position = bulletSpawnPoint.position;
                bullet.transform.rotation = bulletSpawnPoint.rotation;

                bullet.PoolExited();

                soundsComponent.PlayShootSound();

                effectsComponent.PlayParticleEffect();

                canShoot = false;
            }
        }