Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
    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);
    }