public IEnemyState Conditions(float timeElapsed) { // If target is not inside AttackRange, return to chasing if (!Host.ValidateTarget(Host.AttackRange)) { return(new ApproachTarget()); } // after 0.3s, start jump attack if (timeElapsed > 0.3f) { return(new JumpAttack()); } return(null); }
public IEnemyState Conditions(float timeElapsed) { // check that target is still alive if (!Host.ValidateTarget(Host.ChaseRange)) { Host.IdleWanderAnchor = Host.transform.position; return(new IdleStanding()); } // check if target is withing attack range if (Host.Distance(false, Host.transform.position, Host.Target.transform.position, Host.AttackRange * 0.8f, false)) { return(new JumpAttackStartup()); } return(null); }