Exemplo n.º 1
0
        public void Update()
        {
            //early return
            if (currentState == null)
            {
                return;
            }

            //update state
            currentState.Run();

            foreach (Transition t in currentState.Transitions)
            {
                if (t.condition())
                {
                    SetState(StatePool.GetState(t.target));
                }
            }
        }
Exemplo n.º 2
0
 public FSM(System.Type _initialState, IActor _owner)
 {
     owner = _owner;
     SetState(StatePool.GetState(_initialState));
 }