public void Tick(float a_fElapsed) { if (m_nextState != null) { GameState oldState = m_currState; GameState newState = m_nextState; if (m_currState != null) { m_currState.OnLeaveState(m_nextState); } m_nextState.OnEnterState(m_currState); m_currState = m_nextState; m_nextState = null; EventSystem.Get().SendEvent((int)EEventID.GameStateChanged, oldState, newState); } else { if (m_currState != null) { m_currState.Tick(a_fElapsed); } } }
public virtual void Initialize() { AssetManager.Get(); EventSystem.Get(); GameStateManager.Get(); LuaManager.Get(); GuiManager.Get(); }
public virtual void Tick(float a_fElapsed) { GameStateManager.Get().Tick(a_fElapsed); AssetManager.Get().Tick(a_fElapsed); EventSystem.Get().Tick(a_fElapsed); }
public override void OnEnterState(GameState a_preState) { EventSystem.Get().RegisterEventHandler((int)EEventID.EngineScriptLoaded, _OnScriptsLoaded); LuaManager.Get().DoFile("CSEngine.lua"); }