Beispiel #1
0
        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);
        }
Beispiel #2
0
 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();
     }
 }