public override void Execute(EnemyManager obj) { // The loop function during the alert state obj.Alert(); // if the enemy die if (obj.IsDead()) { obj.GetFSM().ChangeState(State_Enemy_Die.Instantiate()); } // If the player die if (!obj.CanMove()) { obj.GetFSM().ChangeState(State_Enemy_Idle.Instantiate()); } // If the player is in the range if (obj.CanAttack()) { obj.GetFSM().ChangeState(State_Enemy_UseSkill.Instantiate()); } // If the player is out of the range for a dwell time if (!obj.CanContinueAlerted()) { obj.GetFSM().ChangeState(State_Enemy_Move.Instantiate()); } }
public static State_Enemy_UseSkill Instantiate() { if (instance == null) { instance = new State_Enemy_UseSkill(); } return(instance); }