Пример #1
0
    //設定狀態
    public void SetState(GameFlowState State, MainGameStateControl m_MainGameStateController)
    {
        GameState   = State;
        m_bRunBegin = false;

        if (m_State != null)
        {
            m_State.StateEnd();
        }

        //設定State
        switch (State)
        {
        case GameFlowState.Init:
            m_State = new InitState(m_MainGameStateController);
            break;

        case GameFlowState.DriveForkKit:
            m_State = new DriveForkleftState(m_MainGameStateController);
            break;

        case GameFlowState.CompleteTest:
            m_State = new CompleteTestState(m_MainGameStateController);
            break;

        case GameFlowState.CompletePrictice:
            m_State = new CompletePricticeState(m_MainGameStateController);
            break;
        }
    }
Пример #2
0
 public void OnLoadGame()
 {
     levelSelectorPanelRef.SetActive(false);
     UICanvasRef.SetActive(true);
     pointerObjectRef.SetActive(true);
     currentGameState = GameFlowState.LoadingLevel;
 }
Пример #3
0
    public void ToState(GameFlowState _state)
    {
        GameObject[] grounds = GameObject.FindGameObjectsWithTag("Ground");
        state = _state;
        Debug.Log("GameFlow ToState" + _state);
        switch (state)
        {
        case GameFlowState.MANAGE:
            dataController.PutMoneyToPlayers();
            break;

        case GameFlowState.READY:
            dataController.ArangeEnemyForBoards();

            break;

        case GameFlowState.BATTLE:
            unfinishGroundCount = grounds.Length;
            break;
        }
        foreach (GameObject ground in grounds)
        {
            ChessBoardController board = ground.GetComponent <ChessBoardController> ();
            if (state == GameFlowState.BATTLE)
            {
                board.OnBattleOver += BattleOverHandler;
            }
            board.SetState(state);
        }

        PlayerController player = GameObject.Find("Player").GetComponent <PlayerController> ();

        player.SetState(state);
    }
Пример #4
0
    private void EnterGameOverState()
    {
        currentGameFlowState = GameFlowState.GameOver;
        gameOverPanel.gameObject.SetActive(true);
        gameOverScoreText.text = currentScore.ToString();

        string name = Regex.Replace(System.Environment.UserName, @"\s+", "");

        scoreboardManager.PostScore(name, currentScore);
    }
Пример #5
0
    void LoadSelectedLevel()
    {
        int mapId = getIndexMapAssetToLoad();

        if (!MapManager.Instance.TrySelectMapById(mapId))
        {
            Debug.LogErrorFormat("Couldn't select map with Id {0}", mapId);
            return;
        }

        currentGameState = GameFlowState.LoadingLevel;
        GameEvents.GameState.OnLoadGame.SafeInvoke();
    }
Пример #6
0
        public void SetState(GameFlowState _state)
        {
            switch (_state)
            {
            case GameFlowState.MANAGE:
                StopBattle();
                break;

            case GameFlowState.READY:
                ReadyBattle();
                break;

            case GameFlowState.BATTLE:
                StartBattle();
                break;
            }
        }
Пример #7
0
    private void ChangeState(GameFlowState newState)
    {
        switch (currentGameFlowState)
        {
        case GameFlowState.StartMenu:
            ExitStartMenuState();
            break;

        case GameFlowState.Playing:
            ExitPlayingState();
            break;

        case GameFlowState.GameOver:
            ExitGameOverState();
            break;

        case GameFlowState.ScoreBoard:
            ExitScoreBoardState();
            break;

        default:
            break;
        }
        switch (newState)
        {
        case GameFlowState.StartMenu:
            EnterStartMenuState();
            break;

        case GameFlowState.Playing:
            EnterPlayingState();
            break;

        case GameFlowState.GameOver:
            EnterGameOverState();
            break;

        case GameFlowState.ScoreBoard:
            EnterScoreBoardState();
            break;

        default:
            break;
        }
    }
Пример #8
0
        public void SetState(GameFlowState state)
        {
            string ext = "";

            switch (state)
            {
            case GameFlowState.MANAGE:
                ext = "现在是排兵布阵阶段";
                break;

            case GameFlowState.READY:
                ext = "现在是即将开始阶段";
                break;

            case GameFlowState.BATTLE:
                ext = "ima是Battle阶段";
                break;
            }
            SetCountText(ext);
        }
Пример #9
0
 private void EnterScoreBoardState()
 {
     currentGameFlowState = GameFlowState.ScoreBoard;
     scoreboardPanel.gameObject.SetActive(true);
     RetrieveScoresFromServer();
 }
Пример #10
0
 private void EnterPlayingState()
 {
     currentGameFlowState = GameFlowState.Playing;
     playingPanel.gameObject.SetActive(true);
     this.Initialise();
 }
Пример #11
0
 private void EnterStartMenuState()
 {
     currentGameFlowState = GameFlowState.StartMenu;
     startMenuPanel.gameObject.SetActive(true);
 }
Пример #12
0
 public void OnGameEnded()
 {
     currentGameState = GameFlowState.ScorePanel;
 }
Пример #13
0
 //Start
 private void Start()
 {
     currentGameState = GameFlowState.LevelSelect;
 }
Пример #14
0
 public void StartGame()
 {
     GameEvents.GameState.OnStartGame.SafeInvoke();
     currentGameState = GameFlowState.inGame;
 }