Create Has Patrol Route Decorator
This commit is contained in:
parent
a8d9ca1783
commit
594ef5f158
|
@ -0,0 +1,14 @@
|
|||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "../Decorators/BTDHasPatrolRoute.h"
|
||||
|
||||
#include "Nakatomi/EnemyAIController.h"
|
||||
|
||||
bool UBTDHasPatrolRoute::CalculateRawConditionValue(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory) const
|
||||
{
|
||||
AEnemyAIController* enemyController = Cast<AEnemyAIController>(OwnerComp.GetAIOwner());
|
||||
AEnemyCharacter* enemyPawn = Cast<AEnemyCharacter>(enemyController->GetPawn());
|
||||
|
||||
return enemyPawn->CurrentPatrolRoute ? true : false;
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "BehaviorTree/BTDecorator.h"
|
||||
#include "BTDHasPatrolRoute.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS(Blueprintable)
|
||||
class NAKATOMI_API UBTDHasPatrolRoute : public UBTDecorator
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
virtual bool CalculateRawConditionValue(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory) const override;
|
||||
};
|
Loading…
Reference in New Issue