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