Compare commits
No commits in common. "03d5b80a0b74d03ae6fb7f2e9faca91833f7df2d" and "a13083e1fea6248ef237c4541b3095e2b3a012a5" have entirely different histories.
03d5b80a0b
...
a13083e1fe
|
@ -1,14 +0,0 @@
|
|||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "../Tasks/BTTClearFocus.h"
|
||||
|
||||
#include "Nakatomi/EnemyAIController.h"
|
||||
|
||||
EBTNodeResult::Type UBTTClearFocus::ExecuteTask(UBehaviorTreeComponent& owner, uint8* memory)
|
||||
{
|
||||
auto enemyController = Cast<AEnemyAIController>(owner.GetAIOwner());
|
||||
enemyController->ClearFocus(EAIFocusPriority::Default);
|
||||
enemyController->SetFocus();
|
||||
return EBTNodeResult::Succeeded;
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "BehaviorTree/BTTaskNode.h"
|
||||
#include "BTTClearFocus.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class NAKATOMI_API UBTTClearFocus : public UBTTaskNode
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
virtual EBTNodeResult::Type ExecuteTask(UBehaviorTreeComponent& owner, uint8* memory) override;
|
||||
|
||||
};
|
|
@ -1,20 +0,0 @@
|
|||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "../Tasks/BTTSetFocus.h"
|
||||
|
||||
#include "BehaviorTree/BlackboardComponent.h"
|
||||
#include "Nakatomi/EnemyAIController.h"
|
||||
#include "Nakatomi/PlayerCharacter.h"
|
||||
|
||||
EBTNodeResult::Type UBTTSetFocus::ExecuteTask(UBehaviorTreeComponent& owner, uint8* memory)
|
||||
{
|
||||
UBlackboardComponent* BlackboardComponent = owner.GetBlackboardComponent();
|
||||
UObject* actor = BlackboardComponent->GetValueAsObject(TargetActorKey.SelectedKeyName);
|
||||
APlayerCharacter* PlayerCharacter = Cast<APlayerCharacter>(actor);
|
||||
|
||||
AEnemyAIController* enemyController = Cast<AEnemyAIController>(owner.GetAIOwner());
|
||||
enemyController->SetFocus(PlayerCharacter, EAIFocusPriority::Gameplay);
|
||||
|
||||
return EBTNodeResult::Succeeded;
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "BehaviorTree/BTTaskNode.h"
|
||||
#include "BTTSetFocus.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class NAKATOMI_API UBTTSetFocus : public UBTTaskNode
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, Category = "Options",
|
||||
Meta = (AllowPrivateAccess = "true", DisplayName = "Target Actor Key"))
|
||||
FBlackboardKeySelector TargetActorKey;
|
||||
|
||||
public:
|
||||
virtual EBTNodeResult::Type ExecuteTask(UBehaviorTreeComponent& owner, uint8* memory) override;
|
||||
|
||||
};
|
Loading…
Reference in New Issue