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 override void Execute(EnemyManager obj) { // The loop function during the idle state of the enemy. obj.Idle(); // If the ememy dies if (obj.IsDead()) { obj.GetFSM().ChangeState(State_Enemy_Die.Instantiate()); } // If the player die if (obj.CanMove()) { obj.GetFSM().ChangeState(State_Enemy_Move.Instantiate()); } }
public override void Execute(EnemyManager obj) { // Function during the move state obj.Move(); // If the ememy dies 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.CanAlerted()) { obj.GetFSM().ChangeState(State_Enemy_Alert.Instantiate()); } }
public override void Execute(EnemyManager obj) { // The function during the useskill loop obj.UseSkill(); // If the enemy is dead 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 out of the range if (!obj.CanContinueAttack()) { obj.GetFSM().ChangeState(State_Enemy_Alert.Instantiate()); } }