Example #1
0
        public bool GoTo <T>() where T : UnityState, new()
        {
            if (CanGoTo <T>())
            {
                _currentState.OnExit();

                _currentState = new T();
                _currentState.OnEnter();

                return(true);
            }

            return(false);
        }
Example #2
0
 private void Start()
 {
     _currentState.OnEnter();
 }