public void Spawn(Vector2 spawnPos, float shootPower, float shootDuration, Vector2 shootDirection) { var bullet = bulletPool.GetRandom(); bullet.Init(); bullet.SetPos(spawnPos); bullet.ShootBullet(shootPower, shootDuration, shootDirection); }
public void Shoot(Vector3 instantinationPos, Vector3 dir) { if (!onCooldown) { var bullet = bulletPool.GetRandom(); bullet.Init(); bullet.SetPos(instantinationPos); bullet.ShootBullet(speed, duration, dir); parrentMonoBehaviour.StartCoroutine(HandleCooldown()); PublishShootEvent(); } }