public InteractableState GetState(InteractableStateType type) { if (!states.ContainsKey(type)) { return(null); } return(states[type]); }
public void GotoState(InteractableStateType key) { if (!states.ContainsKey(key)) { return; } currentState?.Exit(); previousState = currentState; CurrentStateType = key; currentState = states[CurrentStateType]; currentState.Enter(); }
public void AddState(InteractableStateType newType, InteractableState newState) { states.Add(newType, newState); states[newType].Initialize(this); }