Create `OnFire`, `CalculateHits` and `ProcessHits` functions in `EnemyCharacter`

This commit is contained in:
Louis Hobbs 2023-03-13 22:22:56 +00:00
parent 60deefdf96
commit bf742b0224
2 changed files with 25 additions and 0 deletions

View File

@ -36,7 +36,24 @@ UAIPerceptionComponent* AEnemyCharacter::GetPerceptionComponent()
return PerceptionComponent;
}
void AEnemyCharacter::OnFire()
{
TArray<FHitResult> Hits = TArray<FHitResult>();
CalculateHits(&Hits);
ProcessHits(Hits);
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("BANG"));
}
void AEnemyCharacter::BeginPlay()
{
Super::BeginPlay();
}
void AEnemyCharacter::CalculateHits(TArray<FHitResult>* hits)
{
}
void AEnemyCharacter::ProcessHits(TArray<FHitResult> hits)
{
}

View File

@ -37,6 +37,14 @@ public:
UAIPerceptionComponent* GetPerceptionComponent();
virtual void OnFire() override;
protected:
virtual void BeginPlay() override;
private:
virtual void CalculateHits(TArray<FHitResult>* hits) override;
virtual void ProcessHits(TArray<FHitResult> hits) override;
};