private void Start() { m_states.Add(InteractStateIndex.CameraCursor, new PlayerInteractCameraCursorState(this)); m_states.Add(InteractStateIndex.Trigger, new PlayerInteractTriggerState(this)); m_currentState = m_states[startInteractingState]; SetCurrentState(startInteractingState); }
public void SetCurrentState(InteractStateIndex stateIndex) { if (m_currentState != null) { m_currentState.OnExit(); } m_currentState = m_states[stateIndex]; if (m_currentState != null) { m_currentState.OnEnter(); } }
public void Add(InteractStateIndex key, PlayerInteractBaseState state) { m_states.Add(key, state); }