Example #1
0
    public static void UnSubscribePool(PoolOfPools poolToUnSubscribe)
    {
        pools.Remove(poolToUnSubscribe);

        if (pools.Count.Equals(0))
        {
            pools.Clear();
        }
    }
Example #2
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;
            }
        }
Example #3
0
 public static void SubscribePool(PoolOfPools poolToSubscribe)
 {
     pools.Add(poolToSubscribe);
 }