示例#1
0
 public static BrickNormalState Instance()
 {
     if (instance == null)
     {
         instance = new BrickNormalState();
     }
     return(instance);
 }
示例#2
0
    public void triggerBecomeTrap()
    {
        if (sm == null)
        {
            sm = new StateMachine <Brick>(this, BrickNormalState.Instance());
        }

        sm.handleMessage(new StateMsg <Brick>((int)BrickMsg.becomeTrap, null));
    }
示例#3
0
    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;
        }
    }