예제 #1
0
    void Attack(Damage dmg)
    {
        GameObject  bullet    = Instantiate(bulletPrefab) as GameObject;
        MagicBullet bulletCom = bullet.GetComponent <MagicBullet> ();
        Block       block     = BattleField.GetBlock(dmg.target);

        bulletCom.Shoot(block.GetCenterPosition());
        parent.SendDamage(dmg);
    }
예제 #2
0
    IEnumerator Attack(Block block, float delay)
    {
        yield return(new WaitForSeconds(delay));

        GameObject  bullet    = Instantiate(bulletPrefab) as GameObject;
        MagicBullet bulletCom = bullet.GetComponent <MagicBullet> ();

        bulletCom.Shoot(block.GetCenterPosition());
        if (block.state == Block.BlockState.Hero)
        {
            SendDamage(GetDamage(parent.GetHeroInfo(), block.SimpleBlock), block);
        }
    }