/// <summary> /// Sets the state of the global. /// </summary> /// <param name="state">State.</param> public void SetCurrentState(IAIState state) { if (m_CurrentState != state) { if (m_CurrentState) { m_CurrentState.OnExit(); } } m_PrevState = m_CurrentState; m_CurrentState = state; if (m_CurrentState) m_CurrentState.OnStart (); }