public override void GameStateChanged(SGameState pOldState, SGameState pCurrentGameState)
 {
     if (pCurrentGameState == (int)EGameState.Ingame)
     {
         Game.instance.GetComponent <LevelCreator>().GenerateLevel((level) => {
             levelGrid = level;
         });
     }
 }
    void Update()
    {
        SGameState oldState = currentGameState;

        currentGameState = GetCurrentGameState();

        if (oldState != currentGameState)
        {
            Debug.Log("Old Game State: " + oldState + " > " + currentGameState);

            GLogic.GameStateChanged(oldState, currentGameState);

            if (OnGameStateChanged != null)
            {
                OnGameStateChanged(oldState, currentGameState);
            }
        }
    }
 public override void GameStateChanged(SGameState pOldState, SGameState pCurrentGameState)
 {
 }
 public override void Start()
 {
     SGameState.Add((int)EGameState.Ingame, EGameState.Ingame.ToString());
 }
    SGameState GetCurrentGameState()
    {
        SGameState newState = Game.instance.gameLogicImplementation.GetCurrentGameState();

        return(newState);
    }
示例#6
0
 public bool Equals(SGameState pState)
 {
     return(pState.mIndex == this.mIndex);
 }
 /// <summary>
 /// When your \link GameLogicImplementationBase::GetCurrentGameState GetCurrentGameState \endlink returns a
 /// value different from the most recent call, the game state manager will call this method to notify your game logic.
 /// The old state and the now active state are given as parameters.
 /// </summary>
 /// <param name='pOldState'>
 /// The old game state.
 /// </param>
 /// <param name='pCurrentGameState'>
 /// The now active game state.
 /// </param>
 public abstract void GameStateChanged(SGameState pOldState, SGameState pCurrentGameState);