示例#1
0
        public void Close()
        {
            if (m_currentState != null && m_currentState.Leave != null)
            {
                m_currentState.Leave();
            }

            m_currentState = null;
        }
示例#2
0
        public void SwitchTo(TId stateID)
        {
            var newState = m_states[stateID];

            if (m_currentState != null && m_currentState.Leave != null)
            {
                m_currentState.Leave();
            }
            newState?.Enter?.Invoke();
            m_currentState = newState;
        }
示例#3
0
 public void Add(SimpleState <TId> newState)
 {
     m_states.Add(newState.id, newState);
 }