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())); } }
public void DestroyProjectile(BaseProjectile projectile) { projectile.Free(); projectile.transform.SetParent(transform); projectile.MoveTo(spawnPosition); }