Example #1
0
 public void ChangeState(IGameStates newState)
 {
     if (gameState != null)
     {
         gameState.OnExit();
     }
     gameState = newState;
     gameState.OnEnter(this);
 }
Example #2
0
 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> ( );
        }
Example #4
0
        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;
 }
Example #6
0
 public void ChangeState(IGameStates gs)
 {
     gameState = gs;
     gs.OnStateEnter(transform.gameObject);
 }