Ejemplo n.º 1
0
    private void Walk()
    {
        //goes to ideal after walk duration
        walkTimer += Time.deltaTime;

        if (walkTimer > difficultyUtils.walkDuration)
        {
            enemy.ChangeState(new IIdealState());
        }

        //check for
        if (enemy.InMeleeRange())
        {
            enemy.ChangeState(new IAttackState());
        }
    }
Ejemplo n.º 2
0
 public void Execute()
 {
     if (!animator.GetCurrentAnimatorStateInfo(0).IsName("Enemy1_fall") && !animator.GetCurrentAnimatorStateInfo(0).IsName("Enemy1_damage"))
     {
         Attacc();
     }
     if (!enemy.InMeleeRange())
     {
         enemy.ChangeState(new IIdealState());
     }
 }
Ejemplo n.º 3
0
    private void Ideal()
    {
        //goes to walking after ideal duration
        enemy.Animator.SetFloat("Velocity", 0);

        idealTimer += Time.deltaTime;

        if(idealTimer > difficultyUtils.idealDuration)
        {
            enemy.ChangeState(new IWalkState());
        }
    }