public void ChangeState(IGameStates newState) { if (gameState != null) { gameState.OnExit(); } gameState = newState; gameState.OnEnter(this); }
public void ChangeState(IGameStates newGameState) { previousGameState = currentGameState; if (previousGameState != null) { previousGameState.OnStateExit(); } currentGameState = newGameState; currentGameState.OnStateEnter(); }
private void Awake( ) { gameStateController = GameStateController.GetSingletonInstance( ); wordFileReader = WordFileController.GetSingletonInstance( ); healthController = HealthController.GetSingletonInstance( ); healthController.InitializeHealth( ); textManager = GameObject.Find("TextAnchor").GetComponent <TextManager> ( ); textManager.HealthUpdate(healthController.GetHealth( )); inputManager = gameObject.GetComponent <InputManager> ( ); levelManager = gameObject.GetComponent <LevelManager> ( ); }
public EnemyEndGameProgress(EnemyLogicStateMachine stateMachine) { spyState = new PlaySpyState(this); checkOpponentState = new OpponentPassedState(this); medicState = new PlayMedicState(this); weakestCardState = new PlayWeakestCardState(this); playerPointsState = new CheckPlayerPointsState(this); playLowestCardState = new PlayLowestCardState(this); passTurnState = new PassTurnState(this); playHeroState = new PlayHeroState(this); isStronUnitOnBoard = new IsStrongUnitOnBoardState(this); playScorchState = new PlayScorchState(this); playWeatherState = new PlayWeatherEffectState(this); playMusterState = new PlayMusterState(this); playTightBondState = new PlayTightBondState(this); playClearSkiesState = new PlayClearSkiesState(this); this.stateMachine = stateMachine; currentState = checkOpponentState; }
public void ChangeState(IGameStates newState) { endGameState.currentState = newState; }
public void ChangeState(IGameStates gs) { gameState = gs; gs.OnStateEnter(transform.gameObject); }