示例#1
0
文件: Running.cs 项目: limered/LD45
        public override void Enter(StateContext <Game> context)
        {
            MessageBroker.Default.Receive <GameMsgEnd>()
            .Subscribe(end => context.GoToState(new GameOver()))
            .AddTo(this);

            MessageBroker.Default.Receive <GameMsgPause>()
            .Subscribe(pause => context.GoToState(new Paused()))
            .AddTo(this);
        }
示例#2
0
        public override void Enter(StateContext <Game> context)
        {
            MessageBroker.Default.Receive <GameMsgRestart>()
            .Subscribe(restart => context.GoToState(new StartScreen()))
            .AddTo(this);

            MessageBroker.Default.Receive <GameMsgStart>()
            .Subscribe(restart => context.GoToState(new Running()))
            .AddTo(this);
        }
示例#3
0
文件: Loading.cs 项目: limered/LD45
 public override void Enter(StateContext <Game> context)
 {
     MessageBroker.Default.Receive <GameMsgFinishedLoading>()
     .Subscribe(loading => context.GoToState(new StartScreen()))
     .AddTo(this);
 }
示例#4
0
文件: Paused.cs 项目: limered/LD45
 public override void Enter(StateContext <Game> context)
 {
     MessageBroker.Default.Receive <GameMsgUnpause>()
     .Subscribe(unpause => context.GoToState(new Running()))
     .AddTo(this);
 }
示例#5
0
文件: Moving.cs 项目: limered/LD47
 public override void Enter(StateContext <FunnyMovementComponent> context)
 {
     Observable.Timer(TimeSpan.FromSeconds(3))
     .Subscribe(l => context.GoToState(new Standing()))
     .AddTo(this);
 }
示例#6
0
 public void Grow()
 {
     Context.GoToState(new BlowFishState.Growing(this));
 }