Beispiel #1
0
        public void Update()
        {
            bool stateChanged;

            do
            {
                stateChanged = false;
                foreach (var transition in _currentState.Item2)
                {
                    if (transition.Condition(_context))
                    {
                        ChangeCurrentState(transition.TargetState);
                        stateChanged = true;
                        break;
                    }
                }
            }while (stateChanged);
            _currentState.Item1.Update(_context);

            DebugViewer.AddValue(typeof(TContext).Name.CropLast(7), _currentState.Item1.GetType());
        }
Beispiel #2
0
 private void Awake()
 {
     _instance = this;
 }