Exemplo n.º 1
0
    IEnumerator OnTriggerEnter(Collider col)
    {
        if (col && animator.GetBool("isAttacking"))
        {
            yield return(new WaitForSeconds(.75f));

            if (col)
            {
                if (col.GetComponentInChildren <MageStatus>())
                {
                    MageStatus mageStatus = FindObjectOfType <MageStatus>();
                    mageStatus.ApplyDamage(damage);
                }
                if (col.GetComponentInChildren <PlayerStatus>())
                {
                    PlayerStatus playerStatus = FindObjectOfType <PlayerStatus>();
                    playerStatus.ApplyDamage(damage);
                }
            }
        }
    }