Unity行为树插件Behavior Tree Designer记录.Decorator装饰1

本文详细介绍了Unity中Behavior Tree Designer的行为树装饰器Decorator,特别是ParentTask基类及其子类UntilSuccess的工作原理。UntilSuccess装饰器会在其子任务返回成功之前持续执行。同时提到了UntilFailure,它在子任务失败时停止执行。
摘要由CSDN通过智能技术生成

ParentTask

Decorator的基类是ParentTask。先把官方的注释贴出来,方便查找。

Parent Tasks are the composite and decorator tasks within the behavior tree. While the
ParentTask API has no equivalent API to Unity’s MonoBehaviour class, it is still pretty easy
to determine what each method is used for.
// The maximum number of children a parent task can have. Will usually
be 1 or int.MaxValue
public virtual int MaxChildren();
// Boolean value to determine if the current task is a parallel task.
public virtual bool CanRunParallelChildren();
// The index of the currently active child.
public virtual int CurrentChildIndex();
// Boolean value to determine if the current task can execute.
public virtual bool CanExecute();
// Apply a decorator to the executed status.
public virtual TaskStatus Decorate(TaskStatus status);
// Notifies the parent task that the child has been executed and has a
status of childStatus.
public virtual void OnChildExecuted(TaskStatus childStatus);
// Notifies
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值