public static State_Enemy_Alert Instantiate() { if (instance == null) { instance = new State_Enemy_Alert(); } return(instance); }
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()); } }