// 轉生.
 public void GameRestart()
 {
     Maze.Animal animal = GlobalAsset.LastestAnimalOnLayerColor(Player.position.Z.value, Player.Color);
     AssignPlayer(animal);
     manager.RebindPlayer();
     positionHint.ShowHintAt(manager.PlayerBind.binded.transform.position);
     UI_Skill.SetActive(true);
 }
Beispiel #2
0
        static public void Init1(StoryManager manager)
        {
            var ready          = new State();
            var start          = new State();
            var gaming         = new State();
            var waitForRestart = new State();
            var waitForEnd     = new State();
            var end            = new State();

            ready.AddEvent(new Event(
                               () => GameStatus.ready,
                               start,
                               new StoryPlayer().AddMessage("按Enter開始遊戲")
                               ));

            start.AddEvent(new Event(
                               () => TalkBox.end,
                               gaming,
                               new ActionPlayer(
                                   () => {
                GameStatus.pause = false;
                GlobalAsset.controller.GameStart();
            }
                                   )
                               ));

            gaming
            .AddEvent(new Event(
                          () => teachMode,
                          TeachMode(gaming),
                          new ActionPlayer(
                              () => { }
                              )
                          ))
            .AddEvent(new Event(
                          () => GlobalAsset.player.IsDead && GlobalAsset.LastestAnimalOnLayerColor(Player.position.Z.value, Player.Color) == null,
                          waitForEnd,
                          new StoryPlayer().AddMessageWithAction(
                              "物種滅絕...你輸了\n按Enter鍵回主選單",
                              () => {
                GameStatus.pause = true;
                GameStatus.lose  = true;
            }
                              )
                          ))
            .AddEvent(new Event(
                          () => GlobalAsset.player.IsDead && !GameStatus.lose,
                          waitForRestart,
                          new ActionPlayer(() => {
                TalkBox.Show("你已經死了\n按Enter鍵轉生");
            }
                                           )
                          ))
            .AddEvent(new Event(
                          () => GlobalAsset.RateOfColorOn(Player.Color, Player.position.Z.value) == 1f,
                          waitForEnd,
                          new StoryPlayer().AddMessageWithAction(
                              "我方勝利\n按Enter鍵回主選單",
                              () => {
                GameStatus.pause = true;
                GameStatus.win   = true;
            }
                              )
                          ));

            waitForRestart.AddEvent(new Event(
                                        () => TalkBox.end,
                                        gaming,
                                        new ActionPlayer(
                                            () => {
                GameStatus.pause = false;
                GlobalAsset.controller.GameRestart();
            }
                                            )));

            waitForEnd.AddEvent(new Event(
                                    () => TalkBox.end,
                                    end,
                                    new ActionPlayer(
                                        () => GlobalAsset.controller.GotoStartScene()
                                        )));


            manager.currentState = ready;
        }