Exemplo n.º 1
0
    void OnTriggerEnter(Collider other)
    {
        if (other.tag.Equals("Weapon"))
        {
            PlayerAttack player = other.GetComponentInParent <PlayerAttack>();

            if (player != null)
            {
                Animator animator = other.GetComponentInParent <Animator>();
                animator.SetTrigger("Blocked");
                player.CancelInvoke();
                player.ResetAttack();
            }
        }
    }