fixed build errors
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include "NakedDesire/Global/NakedDesireGameMode.h"
|
||||
#include "NakedDesire/Player/NakedDesireCharacter.h"
|
||||
#include "NakedDesire/Stats/StatsManager.h"
|
||||
#include "Perception/AIPerceptionComponent.h"
|
||||
|
||||
void ANPCAIController::SetShouldReactToPlayer(const bool Value)
|
||||
{
|
||||
@@ -38,22 +39,22 @@ void ANPCAIController::OnPossess(APawn* InPawn)
|
||||
|
||||
PlayerCharacter = Cast<ANakedDesireCharacter>(UGameplayStatics::GetPlayerCharacter(GetWorld(), 0));
|
||||
Blackboard->SetValueAsObject("Player", PlayerCharacter);
|
||||
|
||||
PerceptionComponent->OnTargetPerceptionUpdated.AddUniqueDynamic(this, &ANPCAIController::OnTargetPerceptionUpdate);
|
||||
}
|
||||
|
||||
void ANPCAIController::OnUnpossess()
|
||||
void ANPCAIController::OnUnPossess()
|
||||
{
|
||||
if (bCurrentlyObserving && PlayerCharacter)
|
||||
{
|
||||
PlayerCharacter->StatsManager->SetObserved(false);
|
||||
bCurrentlyObserving = false;
|
||||
}
|
||||
Super::OnUnpossess();
|
||||
Super::OnUnPossess();
|
||||
}
|
||||
|
||||
void ANPCAIController::OnTargetPerceptionUpdated(AActor* Actor, FAIStimulus Stimulus)
|
||||
void ANPCAIController::OnTargetPerceptionUpdate(AActor* Actor, FAIStimulus Stimulus)
|
||||
{
|
||||
Super::OnTargetPerceptionUpdated(Actor, Stimulus);
|
||||
|
||||
if (Actor != PlayerCharacter)
|
||||
return;
|
||||
if (Stimulus.Type != UAISense::GetSenseID<UAISense_Sight>())
|
||||
|
||||
@@ -35,7 +35,9 @@ public:
|
||||
void SetShouldReactToPlayer(bool Value);
|
||||
|
||||
protected:
|
||||
UFUNCTION()
|
||||
void OnTargetPerceptionUpdate(AActor* Actor, FAIStimulus Stimulus);
|
||||
|
||||
virtual void OnPossess(APawn* InPawn) override;
|
||||
virtual void OnUnpossess() override;
|
||||
virtual void OnTargetPerceptionUpdated(AActor* Actor, FAIStimulus Stimulus) override;
|
||||
virtual void OnUnPossess() override;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user