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()); } }
public void Execute() { if (!animator.GetCurrentAnimatorStateInfo(0).IsName("Enemy1_fall") && !animator.GetCurrentAnimatorStateInfo(0).IsName("Enemy1_damage")) { Attacc(); } if (!enemy.InMeleeRange()) { enemy.ChangeState(new IIdealState()); } }
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()); } }