Exemplo n.º 1
0
        IEnumerator DamagePlayer()
        {
            animator.SetTrigger("enemyAttack");
            player.DecrementHealthFromPlayer();
            SoundManager.instance.RandomizeSfx(attackSound1, attackSound2);
            yield return(new WaitForSeconds(3f));

            isAttackingPlayer = false;
        }
Exemplo n.º 2
0
        protected override void OnCantMove <T> (T component)
        {
            Bandit hitPlayer = component as Bandit;

            animator.SetTrigger("enemyAttack");
            if (hitPlayer)
            {
                GameObject.FindWithTag("Player").GetComponent <Bandit>().DecrementHealthFromPlayer();
            }
            hitPlayer.DecrementHealthFromPlayer();

            SoundManager.instance.RandomizeSfx(attackSound1, attackSound2);
        }