Create `OnFire`, `CalculateHits` and `ProcessHits` functions in `EnemyCharacter`
This commit is contained in:
parent
60deefdf96
commit
bf742b0224
|
@ -36,7 +36,24 @@ UAIPerceptionComponent* AEnemyCharacter::GetPerceptionComponent()
|
||||||
return PerceptionComponent;
|
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()
|
void AEnemyCharacter::BeginPlay()
|
||||||
{
|
{
|
||||||
Super::BeginPlay();
|
Super::BeginPlay();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AEnemyCharacter::CalculateHits(TArray<FHitResult>* hits)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void AEnemyCharacter::ProcessHits(TArray<FHitResult> hits)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
|
@ -37,6 +37,14 @@ public:
|
||||||
|
|
||||||
UAIPerceptionComponent* GetPerceptionComponent();
|
UAIPerceptionComponent* GetPerceptionComponent();
|
||||||
|
|
||||||
|
virtual void OnFire() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void BeginPlay() override;
|
virtual void BeginPlay() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
virtual void CalculateHits(TArray<FHitResult>* hits) override;
|
||||||
|
|
||||||
|
virtual void ProcessHits(TArray<FHitResult> hits) override;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue