-
Notifications
You must be signed in to change notification settings - Fork 350
common
bobohume edited this page Feb 19, 2021
·
2 revisions
ai行为树代码,可以配合ue蓝图生成go代码,目前excel也能配置出ai行为树
编辑器也是生成代码,再在实现部分填写自己的代码,go的闭包,我感觉,手写代码问题不大
this.Sequence.Init()
condition := betree.Condition{}
aciton := betree.Action{}
//攻击
atk := &betree.Selector{}
atk.AddChild("1_CheckCD", &AICondition{condition, func() bool {
if this.mObj.GetTarget() == nil{
return false
}
if this.mObj.GetSpell().IsSpellRunning(){
return false
}
if !this.mObj.GetSkillTable().IsDefaultValid(){
return false
}
// 检查CD
if this.mObj.GetCooldownTable().GetCooldown(this.mObj.GetSkillTable().m_DefaultSkill.m_SkillData.GetCDGroup()) != 0 {
return false
}
return true
}})
filemonitor为监控文件改变,动态加配配置
simpletimer简单定时器
statematchine为ai状态机