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 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()); } }