public bool IsState <TState>() { if (_currentState == null) { return(false); } return(_currentState.GetType() == typeof(TState)); }
void ChangeStateInternal(AltoState nextState) { if (logVerbose) { string currentStateName = (_currentState != null) ? _currentState.GetType().Name : "null"; Log($"{currentStateName} <color=#f894fc>-></color> {nextState.GetType().Name}"); } if (_currentState != null) { _currentState.onExitNextState = nextState; _currentState.Exit(); } nextState.onEnterPrevState = _currentState; _currentState = nextState; nextState.Enter(); }