UpdateState() public method

public UpdateState ( ) : void
return void
コード例 #1
0
 private void Update()
 {
     if (m_curState != null)
     {
         m_curState.UpdateState();
     }
 }
コード例 #2
0
    void Update()
    {
        // State machine shenanigans
        if (!m_initialised)
        {
            return;
        }

        if (m_currentGameState != null)
        {
            m_currentGameState.UpdateState();
        }

        if (m_nextGameStateIndex != Enums.GameStateNames.GS_00_NULL)
        {
            if (m_currentGameState != null)
            {
                m_currentGameState.ExitState(m_nextGameStateIndex);
            }
            m_currentGameState = m_gameStateDictionary[m_nextGameStateIndex];
            m_currentGameState.EnterState(m_currentGameStateIndex);
            m_currentGameStateIndex = m_nextGameStateIndex;
            m_nextGameStateIndex    = Enums.GameStateNames.GS_00_NULL;
        }
    }