Пример #1
0
 /// <summary>检查条件是否达到</summary>
 public override void Reason(BaseFSM fsm)
 {
     base.Reason(fsm);
     if (patrolComplete)
     {
         fsm.ChangeActiveState(FSMTriggerID.PatrolComplete);
     }
 }
Пример #2
0
 /// <summary>
 /// 检查转换条件
 /// </summary>
 /// <param name="fsm"></param>
 public virtual void Reason(BaseFSM fsm)
 {
     //检查每一个条件,如果有满足的,则转换状态
     for (int i = 0; i < triggers.Count; i++)
     {
         if (triggers[i].HandleEvaluate(fsm))
         {
             fsm.ChangeActiveState(triggers[i].triggerId);
         }
     }
 }