//設定狀態 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; } }
public void OnLoadGame() { levelSelectorPanelRef.SetActive(false); UICanvasRef.SetActive(true); pointerObjectRef.SetActive(true); currentGameState = GameFlowState.LoadingLevel; }
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); }
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); }
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(); }
public void SetState(GameFlowState _state) { switch (_state) { case GameFlowState.MANAGE: StopBattle(); break; case GameFlowState.READY: ReadyBattle(); break; case GameFlowState.BATTLE: StartBattle(); break; } }
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; } }
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); }
private void EnterScoreBoardState() { currentGameFlowState = GameFlowState.ScoreBoard; scoreboardPanel.gameObject.SetActive(true); RetrieveScoresFromServer(); }
private void EnterPlayingState() { currentGameFlowState = GameFlowState.Playing; playingPanel.gameObject.SetActive(true); this.Initialise(); }
private void EnterStartMenuState() { currentGameFlowState = GameFlowState.StartMenu; startMenuPanel.gameObject.SetActive(true); }
public void OnGameEnded() { currentGameState = GameFlowState.ScorePanel; }
//Start private void Start() { currentGameState = GameFlowState.LevelSelect; }
public void StartGame() { GameEvents.GameState.OnStartGame.SafeInvoke(); currentGameState = GameFlowState.inGame; }