示例#1
0
        public bool TryPerformTransition(string edge)
        {
            if (Current == null)
                return false;

            State state = Current.Step(edge);
            if (state == null)
                return false;

            Current = state;
               // Debug.Log("Enter(" + edge + "):  " + Current.Id);
            Current.NotifyOnEnter();
            return true;
        }
示例#2
0
        public bool TrySetStateById(string id)
        {
            foreach(State s in _states)
            {
                if (s.Id == id)
                {
                    Current = s;
                    //Debug.Log("Enter:  " + Current.Id);
                    Current.NotifyOnEnter();
                    return true;
                }
            }

            return false;
        }