public static BrickNormalState Instance() { if (instance == null) { instance = new BrickNormalState(); } return(instance); }
public void triggerBecomeTrap() { if (sm == null) { sm = new StateMachine <Brick>(this, BrickNormalState.Instance()); } sm.handleMessage(new StateMsg <Brick>((int)BrickMsg.becomeTrap, null)); }
public override void onMessage(Brick obj, StateMsg <Brick> msg) { BrickMsg type = (BrickMsg)msg.type; switch (type) { case BrickMsg.fadeInOk: obj.getSM().changeState(BrickNormalState.Instance()); break; } }