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

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

                return(true);
            }

            return(false);
        }
Beispiel #2
0
        private void Awake()
        {
            Type type = Type.GetType(_firstState);

            _currentState = (UnityState)Activator.CreateInstance(type);
        }