/// <summary> /// Cambia de estado. /// </summary> public void SetState <T>() where T : IStateMono { for (int i = 0; i < _states.Count; i++) { if (_states[i].GetType() == typeof(T)) { _currentState.StateSleep(); _currentState = _states[i]; _currentState.StateAwake(); } } }
public void SetStateByName(string name) { for (int i = 0; i < _states.Count; i++) { if (_states[i].GetStateName() == name) { _currentState.StateSleep(); _currentState = _states[i]; _currentState.StateAwake(); } } }