Exemplo n.º 1
0
 public InteractableState GetState(InteractableStateType type)
 {
     if (!states.ContainsKey(type))
     {
         return(null);
     }
     return(states[type]);
 }
Exemplo n.º 2
0
    public void GotoState(InteractableStateType key)
    {
        if (!states.ContainsKey(key))
        {
            return;
        }

        currentState?.Exit();

        previousState    = currentState;
        CurrentStateType = key;
        currentState     = states[CurrentStateType];

        currentState.Enter();
    }
Exemplo n.º 3
0
 public void AddState(InteractableStateType newType, InteractableState newState)
 {
     states.Add(newType, newState);
     states[newType].Initialize(this);
 }