public void Execute() { if (!animator.GetCurrentAnimatorStateInfo(0).IsName("Enemy1_fall") && !animator.GetCurrentAnimatorStateInfo(0).IsName("Enemy1_damage")) { Attacc(); } if (!enemy.InMeleeRange()) { enemy.ChangeState(new IIdeal2State()); } }
public void Execute() { if (!animator.GetCurrentAnimatorStateInfo(0).IsName("Enemy1_fall") && !animator.GetCurrentAnimatorStateInfo(0).IsName("Enemy1_damage")) { if (enemy.ifELeft()) { animator.SetFloat("Velocity", 0); animator.SetBool("isblastanim", true); enemy.StartCoroutine(enemy.blast(3)); } } enemy.ChangeState(new IIdeal2State()); }
private void Ideal() { //goes to walking after ideal duration enemy.Animator.SetFloat("Velocity", 0); idealTimer += Time.deltaTime; if (idealTimer > difficultyUtils.idealDuration) { enemy.ChangeState(new IWalk2State()); } }
private void Walk() { //goes to ideal after walk duration walkTimer += Time.deltaTime; blastTimer += Time.deltaTime; if (blastTimer > difficultyUtils.blastCooldown) { enemy.ChangeState(new IBlast2State()); } if (walkTimer > difficultyUtils.walkDuration) { enemy.ChangeState(new IIdeal2State()); } //check for if (enemy.InMeleeRange()) { enemy.ChangeState(new IAttack2State()); } }