Task are leaf nodes of behavior tree, which perform actual actions 更多...
#include <BTTaskNode.h>
类 UBTTaskNode 继承关系图:Public 成员函数 | |
| void | FinishLatentAbort (UBehaviorTreeComponent &OwnerComp) const |
| helper function: finishes latent aborting | |
| void | FinishLatentTask (UBehaviorTreeComponent &OwnerComp, EBTNodeResult::Type TaskResult) const |
| helper function: finish latent executing | |
| void | ReceivedMessage (UBrainComponent *BrainComp, const FAIMessage &Message) |
| message observer's hook | |
| bool | ShouldIgnoreRestartSelf () const |
| EBTNodeResult::Type | WrappedAbortTask (UBehaviorTreeComponent &OwnerComp, uint8 *NodeMemory) const |
| wrapper for node instancing: AbortTask | |
| EBTNodeResult::Type | WrappedExecuteTask (UBehaviorTreeComponent &OwnerComp, uint8 *NodeMemory) const |
| wrapper for node instancing: ExecuteTask | |
| void | WrappedOnTaskFinished (UBehaviorTreeComponent &OwnerComp, uint8 *NodeMemory, EBTNodeResult::Type TaskResult) const |
| wrapper for node instancing: OnTaskFinished | |
| bool | WrappedTickTask (UBehaviorTreeComponent &OwnerComp, uint8 *NodeMemory, float DeltaSeconds, float &NextNeededDeltaTime) const |
| wrapper for node instancing: TickTask 更多... | |
Public 属性 | |
| TArray< UBTService * > | Services |
| service nodes | |
Protected 成员函数 | |
| virtual EBTNodeResult::Type | AbortTask (UBehaviorTreeComponent &OwnerComp, uint8 *NodeMemory) |
| aborts this task, should return Aborted or InProgress (use FinishLatentAbort() when returning InProgress) this function should be considered as const (don't modify state of object) if node is not instanced! | |
| virtual void | OnMessage (UBehaviorTreeComponent &OwnerComp, uint8 *NodeMemory, FName Message, int32 RequestID, bool bSuccess) |
| message handler, default implementation will finish latent execution/abortion this function should be considered as const (don't modify state of object) if node is not instanced! | |
| virtual void | OnTaskFinished (UBehaviorTreeComponent &OwnerComp, uint8 *NodeMemory, EBTNodeResult::Type TaskResult) |
| called when task execution is finished this function should be considered as const (don't modify state of object) if node is not instanced! | |
| void | StopWaitingForMessages (UBehaviorTreeComponent &OwnerComp) const |
| unregister message observers | |
| virtual void | TickTask (UBehaviorTreeComponent &OwnerComp, uint8 *NodeMemory, float DeltaSeconds) |
| ticks this task this function should be considered as const (don't modify state of object) if node is not instanced! | |
| void | WaitForMessage (UBehaviorTreeComponent &OwnerComp, FName MessageType) const |
| register message observer | |
Task are leaf nodes of behavior tree, which perform actual actions
Because some of them can be instanced for specific AI, following virtual functions are not marked as const:
If your node is not being instanced (default behavior), DO NOT change any properties of object within those functions! Template nodes are shared across all behavior tree components using the same tree asset and must store their runtime properties in provided NodeMemory block (allocation size determined by GetInstanceMemorySize() )
| FORCEINLINE bool UBTTaskNode::ShouldIgnoreRestartSelf | ( | ) | const |
| bool UBTTaskNode::WrappedTickTask | ( | UBehaviorTreeComponent & | OwnerComp, |
| uint8 * | NodeMemory, | ||
| float | DeltaSeconds, | ||
| float & | NextNeededDeltaTime | ||
| ) | const |
wrapper for node instancing: TickTask
| OwnerComp | The behavior tree owner of this node |
| NodeMemory | The instance memory of the current node |
| DeltaSeconds | DeltaTime since last call |
| NextNeededDeltaTime | In out parameter, if this node needs a smaller DeltaTime it is his responsibility to change it |