public override void onMessage(AIMoveController obj, StateMsg <AIMoveController> msg) { AIMsg type = (AIMsg)msg.type; switch (type) { case AIMsg.reFindPath: case AIMsg.moveTimeIsOver: obj.getSM().changeState(AIFindingPathState.Instance()); break; case AIMsg.catchPlayer: obj.getSM().changeState(AICatchPlayerState.Instance()); break; case AIMsg.catchByTrap: obj.getSM().changeState(AICatchByTrapState.Instance()); break; case AIMsg.waitForSomebody: AIMoveController ai = (AIMoveController)msg.sender; obj.setWaitThisAI(ai); obj.getSM().changeState(AIWaitState.Instance()); break; } }
public override void onMessage(AIMoveController obj, StateMsg <AIMoveController> msg) { AIMsg type = (AIMsg)msg.type; switch (type) { case AIMsg.reFindPath: obj.movable.getSM().handleMessage(new StateMsg <Movable>((int)MovableMsg.breakKinematic, null)); obj.getSM().changeState(AIFindingPathState.Instance()); break; case AIMsg.catchPlayer: obj.getSM().changeState(AICatchPlayerState.Instance()); break; } }
public override void onMessage(AIMoveController obj, StateMsg <AIMoveController> msg) { AIMsg type = (AIMsg)msg.type; switch (type) { case AIMsg.findPathOk: obj.getSM().changeState(AIMoveState.Instance()); break; case AIMsg.catchByTrap: obj.getSM().changeState(AICatchByTrapState.Instance()); break; case AIMsg.catchPlayer: obj.getSM().changeState(AICatchPlayerState.Instance()); break; } }