• 注册
欢迎加入behaviac Q&A网站。behaviac是腾讯开源组件https://github.com/TencentOpen/behaviac 官方网站:http://www.behaviac.com/,提供各种文档和教程及手册 为了您及时的获得您最新问题的评论或者回答,请提供并验证您的邮箱
欢迎来到 behaviac Q&A。 您在bbs里的问题,管理员会当下就收到通知,不要担心管理员看不到您的问题。也请在bbs里提供您的email,这样就可以第一时间收到关于回答,评论的email的通知了。 为了节省大家的时间,请表达好你的问题,提供必要上下文,版本号,平台信息,重现步骤等。

为什么在状态节点上添加前置附件,执行时机选Enter,但仍然会每帧都执行一次?

0 喜欢 0 不喜欢
90 浏览
下面是调用栈信息:btexec随着每次的update都会调用一次,而每次btexec的调用都会执行到前置附件这里,与它是enter还是update类型没有关系

 

>    Void BaseActorAIAgent:SetIdleState ()+0x0 at E:\xgame2\client\trunk\Assets\XGame\Script\GameLogic\ActorMgr\ActorComponents\BT\BaseActorAIAgent.cs:346    C#
     EBTStatus behaviac.Precondition_bt_RTMeleeAIState_attach39:update_impl (Agent, EBTStatus)+0x8 at E:\xgame2\client\trunk\Assets\XGame\Script\GameLogic\ActorMgr\ActorComponents\BT\behaviac_generated\behaviors\generated_behaviors.cs:3263    C#
     Boolean behaviac.AttachAction:Evaluate (Agent)+0x19 at E:\xgame2\client\trunk\Assets\XGame\Script\behaviac\runtime\BehaviorTree\Attachments\AttachAction.cs:167    C#
     Boolean behaviac.BehaviorNode:CheckPreconditions (Agent, Boolean)+0xa0 at E:\xgame2\client\trunk\Assets\XGame\Script\behaviac\runtime\BehaviorTree\BehaviorTree.cs:1233    C#
     Boolean behaviac.BehaviorTask:CheckPreconditions (Agent, Boolean)+0x26 at E:\xgame2\client\trunk\Assets\XGame\Script\behaviac\runtime\BehaviorTree\BehaviorTree_task.cs:669    C#
     Boolean behaviac.BehaviorTask:onenter_action (Agent)+0x3 at E:\xgame2\client\trunk\Assets\XGame\Script\behaviac\runtime\BehaviorTree\BehaviorTree_task.cs:678    C#
     EBTStatus behaviac.BehaviorTask:exec (Agent, EBTStatus)+0xb4 at E:\xgame2\client\trunk\Assets\XGame\Script\behaviac\runtime\BehaviorTree\BehaviorTree_task.cs:173    C#
     EBTStatus behaviac.BehaviorTask:exec (Agent)+0x5 at E:\xgame2\client\trunk\Assets\XGame\Script\behaviac\runtime\BehaviorTree\BehaviorTree_task.cs:148    C#
     EBTStatus FSMTask:UpdateFSM (Agent, EBTStatus)+0x45 at E:\xgame2\client\trunk\Assets\XGame\Script\behaviac\runtime\FSM\FSM.cs:122    C#
     EBTStatus FSMTask:update (Agent, EBTStatus)+0x2e at E:\xgame2\client\trunk\Assets\XGame\Script\behaviac\runtime\FSM\FSM.cs:182    C#
     EBTStatus FSMTask:update_current (Agent, EBTStatus)+0x3 at E:\xgame2\client\trunk\Assets\XGame\Script\behaviac\runtime\FSM\FSM.cs:172    C#
     EBTStatus behaviac.BehaviorTask:exec (Agent, EBTStatus)+0x109 at E:\xgame2\client\trunk\Assets\XGame\Script\behaviac\runtime\BehaviorTree\BehaviorTree_task.cs:196    C#
     EBTStatus behaviac.SingeChildTask:update (Agent, EBTStatus)+0x13 at E:\xgame2\client\trunk\Assets\XGame\Script\behaviac\runtime\BehaviorTree\BehaviorTree_task.cs:1226    C#
     EBTStatus behaviac.BehaviorTreeTask:update (Agent, EBTStatus)+0x30 at E:\xgame2\client\trunk\Assets\XGame\Script\behaviac\runtime\BehaviorTree\BehaviorTree_task.cs:1483    C#
     EBTStatus behaviac.BehaviorTreeTask:update_current (Agent, EBTStatus)+0x47 at E:\xgame2\client\trunk\Assets\XGame\Script\behaviac\runtime\BehaviorTree\BehaviorTree_task.cs:1461    C#
     EBTStatus behaviac.BehaviorTask:exec (Agent, EBTStatus)+0x109 at E:\xgame2\client\trunk\Assets\XGame\Script\behaviac\runtime\BehaviorTree\BehaviorTree_task.cs:196    C#
     EBTStatus behaviac.BehaviorTask:exec (Agent)+0x5 at E:\xgame2\client\trunk\Assets\XGame\Script\behaviac\runtime\BehaviorTree\BehaviorTree_task.cs:148    C#
     EBTStatus behaviac.Agent:btexec_ ()+0x19 at E:\xgame2\client\trunk\Assets\XGame\Script\behaviac\runtime\Agent\Agent.cs:1442    C#
     EBTStatus behaviac.Agent:btexec ()+0x24 at E:\xgame2\client\trunk\Assets\XGame\Script\behaviac\runtime\Agent\Agent.cs:1534    C#
最新提问 2月 14 用户: goodbless (120 分)

1个回答

0 喜欢 0 不喜欢
是因为所在的节点一直在enter吧,这样onenter_action就一直被调用,看到你用到了FSM,截图看看你的行为树
最新回答 2月 14 用户: cainhuang (33,810 分)
...