public override void Reason()
 {
     if (!PlayerInAttackRange()) // 超出攻击范围
     {
         FsmSystem.ChangeStateTo <NPCChasePlayerState>();
     }
 }
 public override void Reason()
 {
     if (PlayerInView()) //npc看到玩家, 开始追逐玩家
     {
         FsmSystem.ChangeStateTo <NPCChasePlayerState>();
     }
 }
示例#3
0
 public override void Reason()
 {
     if (!PlayerInView()) //npc视野失去玩家, 开始巡逻
     {
         FsmSystem.ChangeStateTo <NPCPatrollingState>();
     }
     else if (PlayerInAttackRange()) // 玩家进入npc攻击范围
     {
         FsmSystem.ChangeStateTo <NPCAttackPlayerState>();
     }
 }