Exemplo n.º 1
0
    IEnumerator Attack()
    {
        anim.SetBool("isRunBoy", false);
        anim.SetBool("isAttackBoy", true);
        anim.SetBool("isIdleBoy", false);
        yield return(new WaitForSeconds(1f));

        isAttack = true;
        //nav.speed = 0f;
        //nav.acceleration = 0; TTTTTT

        //anim.SetBool("isDefenseMonster", false);
        //anim.SetBool("isRetorcerMonster", false);
        //yield return new WaitForSeconds(1.5f);
        //anim.speed = 0.7f;
        nav.SetDestination(this.transform.position);
        if (contador < 1)
        {
            st.restLife(damage);
            contador++;
        }

        yield return(new WaitForSeconds(0.5f));

        isAttack = false;
        anim.SetBool("isAttackBoy", false);
        //anim.speed = 1f;
        //nav.speed = 20;
        //nav.acceleration = 10;
        contador = 0;
    }
Exemplo n.º 2
0
    IEnumerator Attack()
    {
        anim.SetBool("isWalkingMonster", false);
        anim.SetBool("isAttackMonster", true);
        anim.SetBool("isIdleMonster", false);
        //anim.SetBool("isDefenseMonster", false);
        anim.SetBool("isRetorcerMonster", false);
        yield return(new WaitForSeconds(1f));

        isAttack = true;
        //yield return new WaitForSeconds(1.5f);
        nav.SetDestination(this.transform.position);
        //anim.speed = 0.4f;

        if (contador < 1)
        {
            st.restLife(damage);
            contador++;
        }

        yield return(new WaitForSeconds(0.5f));

        anim.SetBool("isAttackMonster", false);
        anim.speed = 1f;

        contador = 0;
    }
Exemplo n.º 3
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag.Equals("Player"))
     {
         st.restLife(damage);
     }
 }