Space Plunder
Loading...
Searching...
No Matches
UBTTask_Shoot Class Reference

#include <BTTask_Shoot.h>

Inheritance diagram for UBTTask_Shoot:

Public Member Functions

 UBTTask_Shoot ()
 

Public Attributes

bool bStartShooting = true
 

Protected Member Functions

virtual EBTNodeResult::Type ExecuteTask (UBehaviorTreeComponent &OwnerComp, uint8 *NodeMemory) override
 
virtual FString GetStaticDescription () const override
 

Detailed Description

UBTTask_Shoot is a behavior tree task node that represents shooting action for an AI character.

Constructor & Destructor Documentation

◆ UBTTask_Shoot()

UBTTask_Shoot::UBTTask_Shoot ( )
13{
14 NodeName = TEXT("Shoot");
15}

Member Function Documentation

◆ ExecuteTask()

EBTNodeResult::Type UBTTask_Shoot::ExecuteTask ( UBehaviorTreeComponent & OwnerComp,
uint8 * NodeMemory )
overrideprotectedvirtual
18{
19 TRACE_CPUPROFILER_EVENT_SCOPE(UBTTask_Shoot::ExecuteTask);
20 SCOPE_CYCLE_COUNTER(STATGROUP_AIToolKit_Behaviors);
21 SCOPE_CYCLE_COUNTER(STATGROUP_AIToolKit_Tasks);
22
23 IAIActionsInterface* AIActions = Cast<IAIActionsInterface>(OwnerComp.GetAIOwner());
24 if(AIActions != nullptr)
25 {
26 AIActions->ShootAction(bStartShooting);
27 return EBTNodeResult::Succeeded;
28 }
29 return EBTNodeResult::Failed;
30}
Definition AIActionsInterface.h:20
virtual void ShootAction(const bool bStartShooting=true)=0
virtual EBTNodeResult::Type ExecuteTask(UBehaviorTreeComponent &OwnerComp, uint8 *NodeMemory) override
Definition BTTask_Shoot.cpp:17
bool bStartShooting
Definition BTTask_Shoot.h:21

◆ GetStaticDescription()

FString UBTTask_Shoot::GetStaticDescription ( ) const
overrideprotectedvirtual
33{
34 FString Description;
35 Description += FString::Printf(TEXT("\nbStart Shooting: %s"), bStartShooting ? TEXT("True") : TEXT("False"));
36 return Description;
37}

Member Data Documentation

◆ bStartShooting

bool UBTTask_Shoot::bStartShooting = true

The documentation for this class was generated from the following files: