public override object OnMessage(Enemy owner, LocalMsg msg) { if (msg.eventID == LocalMsg.ID.onTurn) { owner.FSM.ChangeState(new AttackState("someparameter")); } return(null); }
//receive selfEvent public override object OnMessage(Enemy owner, LocalMsg msg) { if (msg.eventID == LocalMsg.ID.onAttackEnd) { owner.FSM.ChangeState(new IdleState()); } return(null); }
public override object OnMessage(Enemy owner, LocalMsg msg) { if (msg.eventID == LocalMsg.ID.onHurt) { if (owner.Health <= 0) { owner.FSM.ChangeState(new DeadState()); } } return(null); }