Exemplo n.º 1
0
 /// <summary>
 /// 检测冲突跳转,获取出当前所有同样需要跳转的子状态 by吴江
 /// </summary>
 /// <param name="_validTransitions"></param>
 /// <param name="_event"></param>
 public void TestTransitions(ref List <Transition> _validTransitions, Event _event)
 {
     for (int i = 0; i < currentStates.Count; ++i)
     {
         State activeChild = currentStates[i];
         // NOTE: if parent transition triggerred, the child should always execute onExit transition
         bool hasTranstion = false;
         for (int j = 0; j < activeChild.transitionList.Count; ++j)
         {
             Transition transition = activeChild.transitionList[j];
             if (transition.TestEvent(_event))
             {
                 _validTransitions.Add(transition);
                 hasTranstion = true;
                 break;
             }
         }
         if (!hasTranstion)
         {
             activeChild.TestTransitions(ref _validTransitions, _event);
         }
     }
 }