public void Close() { if (m_currentState != null && m_currentState.Leave != null) { m_currentState.Leave(); } m_currentState = null; }
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; }
public void Add(SimpleState <TId> newState) { m_states.Add(newState.id, newState); }