public void SetState(Enum state) { if (_currentState.exitAction != null) { _currentState.exitAction(_owner); } _currentState = _states[state]; if (_currentState.enterAction != null) { _currentState.enterAction(_owner); } }
public void ChangeState(Enum state) { if (m_currentState.exitAction != null) { m_currentState.exitAction(); } m_currentStateID = state; m_currentState = _states[state]; if (m_currentState.enterAction != null) { m_currentState.enterAction(); } }