最近使用Behavior Designer设计AI。
遇到的一些情况记录备用:
--------------------------------------------------------
1 通常行为树使用黑板Black Board记录数据。Behavior Designer可以直接在Variables选项卡里添加变量。
2 Behavior Designer的子节点定义好SharedInt变量,然后可以通过该节点的Inspector选项卡,关联到1中你定义的变量。
只需要点击变量后面的“小圆点”,暂且称之为“关联按钮”。
3 点击“关联按钮”关联变量时,死活找不到在1中定义的变量。
问题:肯定是Variables里的变量类型没有设置正确。怎么设置变量类型,看4.
4 在Variables选项卡中添加一个变量后,仔细一点会发现并不是你选择的那个类型。点一下你刚刚定义好的那个变量,你就可以改变它的类型了。。。
---------------------------------------------------------
将一颗行为树作为另一颗行为树的子节点:
1 添加Behavior Tree Reference节点。
Add Task -> Actions -> Behavior Tree Reference 。
2 选中该节点,切换到“Inspector”选项卡,设置“External Behaviors”的个数,比如1;然后就可以将你之前导出的行为树拖到该节点了。
---