Beispiel #1
0
 protected void Attack(List <BaseEntity> enemies)
 {
     if (_canAttack)
     {
         _canAttack = false;
         BaseProjectile newProjectile = _projectilePool.GetProjectile(projectile.GetProjectileType());
         newProjectile.MoveTo(transform.position);
         newProjectile.transform.SetParent(transform);
         newProjectile.Launch(enemies[0]);
         StartCoroutine(AttackCooldown(GetCooldown()));
     }
 }
Beispiel #2
0
 public void DestroyProjectile(BaseProjectile projectile)
 {
     projectile.Free();
     projectile.transform.SetParent(transform);
     projectile.MoveTo(spawnPosition);
 }