IEnumerator Shoot()
{
while(quantBullet <= 4)
{
GameObject bullet = Instantiate(bulletPrefab, shotSpawner.position, shotSpawner.rotation);
Rigidbody2D rb = bullet.GetComponent();
rb.AddForce(shotSpawner.up * bulletForce, ForceMode2D.Impulse);
quantBullet++;
yield return new WaitForSeconds(2f);
if (quantBullet == 4)
{
pack = true;
}
if(pack == true)
{
yield break;
}
yield return null;
}
}