private Attack CreateAttack(ISkillOwner owner, Action <IBody> onHit, Action <IBody> onKill) { int damage = (int)(owner.GetDamage() * this.damage); Attack attack = new Attack(owner, damage, onHit, onKill); attack.onHit += target => { if (hitSound != null) { AudioManager.PlaySound(hitSound); } if (hitEffect != null) { var effect = GlobalObjectPool.GetPooledObject(hitEffect); effect.transform.position = target.GetPosition(); effect.Play(); } }; return(attack); }
private void Shoot(Attack attack, List <string> targetTags, Vector3 src, Vector3 direction) { Bullet bullet = GlobalObjectPool.GetPooledObject(bulletPrefab); bullet.Shooted(attack, targetTags, hitGround, src, direction, speed, life); }